|
| 1 | +name: Main tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - stable/3.* |
| 8 | + paths-ignore: |
| 9 | + - '**.md' |
| 10 | + - 'docs/**' |
| 11 | + - 'RELEASE_NOTES/**' |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: shopify-cli-main-${{ github.run_id }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +env: |
| 18 | + DEBUG: '1' |
| 19 | + SHOPIFY_CLI_ENV: development |
| 20 | + SHOPIFY_CONFIG: debug |
| 21 | + PNPM_VERSION: '10.11.1' |
| 22 | + BUNDLE_WITHOUT: 'test:development' |
| 23 | + SHOPIFY_FLAG_CLIENT_ID: ${{ secrets.SHOPIFY_FLAG_CLIENT_ID }} |
| 24 | + GH_TOKEN: ${{ secrets.SHOPIFY_GH_READ_CONTENT_TOKEN }} |
| 25 | + GH_TOKEN_SHOP: ${{ secrets.SHOP_GH_READ_CONTENT_TOKEN }} |
| 26 | + DEFAULT_NODE_VERSION: '24.1.0' |
| 27 | + |
| 28 | +jobs: |
| 29 | + main: |
| 30 | + name: '[Main] Node ${{ matrix.node }} in ${{ matrix.os }}' |
| 31 | + runs-on: ${{ matrix.os }} |
| 32 | + timeout-minutes: 30 |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] |
| 36 | + node: [ '20.14.0', '22.2.0', '24.1.0' ] |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v3 |
| 39 | + name: Checkout [${{ github.ref_name }}] |
| 40 | + with: |
| 41 | + fetch-depth: 1 |
| 42 | + - name: Setup deps |
| 43 | + uses: ./.github/actions/setup-cli-deps |
| 44 | + with: |
| 45 | + node-version: ${{ matrix.node }} |
| 46 | + - name: Build |
| 47 | + run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream |
| 48 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '24.1.0' }} |
| 49 | + - name: Lint |
| 50 | + run: pnpm nx run-many --all --skip-nx-cache --target=lint --output-style=stream |
| 51 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '24.1.0' }} |
| 52 | + - name: Type-check |
| 53 | + run: pnpm nx run-many --all --skip-nx-cache --target=type-check --output-style=stream |
| 54 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '24.1.0' }} |
| 55 | + - name: Bundle |
| 56 | + run: pnpm nx run-many --all --skip-nx-cache --target=bundle --output-style=stream |
| 57 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '24.1.0' }} |
| 58 | + - name: Unit tests |
| 59 | + run: pnpm vitest run |
| 60 | + env: |
| 61 | + VITEST_MIN_THREADS: "1" |
| 62 | + VITEST_MAX_THREADS: "4" |
| 63 | + - name: Acceptance tests |
| 64 | + if: ${{ matrix.node == '24.1.0' }} |
| 65 | + env: |
| 66 | + SHOPIFY_CLI_PARTNERS_TOKEN: ${{ secrets.SHOPIFY_CLI_PARTNERS_TOKEN }} |
| 67 | + run: pnpm nx run features:test |
| 68 | + - name: Send Slack notification on failure |
| 69 | + uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # [email protected] |
| 70 | + if: ${{ failure() && !cancelled() }} |
| 71 | + with: |
| 72 | + payload: | |
| 73 | + { |
| 74 | + "build_url": "https://github.com/Shopify/cli/actions/runs/${{ github.run_id }}" |
| 75 | + } |
| 76 | + env: |
| 77 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 78 | + - name: Run and save test coverage |
| 79 | + uses: ./.github/actions/run-and-save-test-coverage |
| 80 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '24.1.0' }} |
| 81 | + with: |
| 82 | + branch-name: ${{ github.ref_name }} |
0 commit comments