[Unit Test] Postcard Server Test #2047
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint the code | |
on: | |
pull_request: | |
branches: [main, develop] | |
paths-ignore: | |
- '**/README.md' | |
jobs: | |
lint: | |
name: lint the dart code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_ASSETS_KEY }} | |
- name: Create env file | |
run: | | |
touch .env | |
echo INDEXER_MAINNET_API_URL=${{ secrets.INDEXER_STAGING_API_URL }} >> .env | |
echo INDEXER_TESTNET_API_URL=${{ secrets.INDEXER_TESTNET_API_URL }} >> .env | |
echo WEB3_RPC_MAINNET_URL=${{ secrets.WEB3_RPC_MAINNET_URL }} >> .env | |
echo WEB3_RPC_TESTNET_URL=${{ secrets.WEB3_RPC_TESTNET_URL }} >> .env | |
echo TEZOS_NODE_CLIENT_MAINNET_URL=${{ secrets.TEZOS_NODE_CLIENT_MAINNET_URL }} >> .env | |
echo TEZOS_NODE_CLIENT_TESTNET_URL=${{ secrets.TEZOS_NODE_CLIENT_TESTNET_URL }} >> .env | |
echo BITMARK_API_MAINNET_URL=${{ secrets.BITMARK_API_MAINNET_URL }} >> .env | |
echo BITMARK_API_TESTNET_URL=${{ secrets.BITMARK_API_TESTNET_URL }} >> .env | |
echo FERAL_FILE_API_MAINNET_URL=${{ secrets.FERAL_FILE_API_MAINNET_URL }} >> .env | |
echo FERAL_FILE_API_TESTNET_URL=${{ secrets.FERAL_FILE_API_TESTNET_URL }} >> .env | |
echo FERAL_FILE_SECRET_KEY_TESTNET=${{ secrets.FERAL_FILE_SECRET_KEY_TESTNET }} >> .env | |
echo FERAL_FILE_SECRET_KEY_MAINNET=${{ secrets.FERAL_FILE_SECRET_KEY_MAINNET }} >> .env | |
echo FERAL_FILE_ASSET_URL_TESTNET=${{ secrets.FERAL_FILE_ASSET_URL_TESTNET }} >> .env | |
echo FERAL_FILE_ASSET_URL_MAINNET=${{ secrets.FERAL_FILE_ASSET_URL_MAINNET }} >> .env | |
echo EXTENSION_SUPPORT_MAINNET_URL=${{ secrets.EXTENSION_SUPPORT_MAINNET_URL }} >> .env | |
echo EXTENSION_SUPPORT_TESTNET_URL=${{ secrets.EXTENSION_SUPPORT_TESTNET_URL }} >> .env | |
echo CONNECT_WEBSOCKET_MAINNET_URL=${{ secrets.CONNECT_WEBSOCKET_MAINNET_URL }} >> .env | |
echo CONNECT_WEBSOCKET_TESTNET_URL=${{ secrets.CONNECT_WEBSOCKET_TESTNET_URL }} >> .env | |
echo AUTONOMY_AUTH_URL=${{ secrets.AUTONOMY_AUTH_STAGING_URL }} >> .env | |
echo CUSTOMER_SUPPORT_URL=${{ secrets.CUSTOMER_SUPPORT_STAGING_URL }} >> .env | |
echo RENDERING_REPORT_URL=${{ secrets.RENDERING_REPORT_STAGING_URL }} >> .env | |
echo FEED_URL=${{ secrets.FEED_STAGING_URL }} >> .env | |
echo CURRENCY_EXCHANGE_URL=${{ secrets.CURRENCY_EXCHANGE_URL }} >> .env | |
echo AUTONOMY_PUBDOC_URL=${{ secrets.AUTONOMY_PUBDOC_URL }} >> .env | |
echo AUTONOMY_IPFS_PREFIX=${{ secrets.AUTONOMY_IPFS_PREFIX_DEV }} >> .env | |
echo FERAL_FILE_AUTHORIZATION_PREFIX=${{ secrets.FERAL_FILE_AUTHORIZATION_PREFIX }} >> .env | |
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env | |
echo ONESIGNAL_APP_ID=${{ secrets.ONESIGNAL_DEV_APP_ID }} >> .env | |
echo AWS_IDENTITY_POOL_ID=${{ secrets.AWS_IDENTITY_POOL_ID }} >> .env | |
echo AUTONOMY_SHARD_SERVICE=${{ secrets.AUTONOMY_SHARD_SERVICE }} >> .env | |
echo METRIC_ENDPOINT=${{ secrets.METRIC_ENDPOINT }} >> .env | |
echo METRIC_SECRET_KEY=${{ secrets.METRIC_SECRET_KEY }} >> .env | |
echo BRANCH_KEY=${{ secrets.BRANCH_KEY }} >> .env | |
echo MIXPANEL_KEY=${{ secrets.MIXPANEL_KEY }} >> .env | |
cat .env | |
- name: Submoudles update | |
run: git -c submodule.auto-test.update=none submodule update --init --recursive | |
- run: flutter pub get | |
- uses: reviewdog/action-setup@v1 | |
with: | |
reviewdog_version: latest | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install codespell | |
run: pip install codespell | |
- name: Get changed files | |
id: changed-files | |
run: | | |
if ${{ github.event_name == 'pull_request' }}; then | |
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD --diff-filter=ACMRTUXB | xargs)" >> $GITHUB_OUTPUT | |
else | |
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} --diff-filter=ACMRTUXB | xargs)" >> $GITHUB_OUTPUT | |
fi | |
- name: Code review and auto-fix the changed files | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
for file in ${{ steps.changed-files.outputs.changed_files }}; do | |
echo "fixing: $file" | |
if [[ $file == *.dart ]]; then | |
flutter analyze --no-preamble $file | reviewdog -efm="%p%t%r • %m • %f:%l:%c • %s" -name=flutter-analyze -reporter=github-pr-review | |
dart format $file | |
dart fix --apply $file | |
else | |
echo "skipping non-Go file: $file" | |
fi | |
codespell -q 3 -w -I .codespellignore --skip "**/*.g.dart,*.svg" $file | reviewdog -efm="%f:%l: %m" -name=codespell -reporter=github-pr-review || true | |
done | |
- name: suggester / dart fixes | |
uses: reviewdog/action-suggester@v1 | |
with: | |
tool_name: dart fix | |
filter_mode: added | |
cleanup: true | |
gitleaks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: gitleaks | |
uses: reviewdog/action-gitleaks@v1 | |
with: | |
reporter: github-pr-review | |
dotenv-linter: | |
name: runner / dotenv-linter | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run dotenv-linter with code suggestions | |
uses: dotenv-linter/action-dotenv-linter@v2 | |
with: | |
reporter: github-code-suggestions | |
misspell: | |
name: Check code spelling | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code. | |
uses: actions/checkout@v4 | |
- name: misspell | |
uses: reviewdog/action-misspell@v1 | |
with: | |
reporter: github-pr-review | |
level: warning | |
locale: "US" | |
pattern: | | |
*.dart | |
*.swift | |
*.kt |