Skip to content

Commit

Permalink
test(ci): move cli test to separate workflow without sharding (#5292)
Browse files Browse the repository at this point in the history
* test(ci): move cli test to separate workflow without sharding

* test(cli): re-enable cli tests
  • Loading branch information
binoy14 committed Nov 30, 2023
1 parent df3152f commit 91d2481
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/cli-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CLI Unit tests

on:
# Build on pushes branches that have a PR (including drafts)
pull_request:
# Build on commits pushed to branches without a PR if it's in the allowlist
push:
branches: [next]

jobs:
cli-test:
timeout-minutes: 60
name: CLI Tests (${{ matrix.os }} / node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
continue-on-error: ${{ matrix.experimental }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [18, 20]
experimental: [false]
# include:
# - os: windows-latest
# node: 16
# experimental: true

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-${{ env.cache-name }}-
${{ runner.os }}-modules-
${{ runner.os }}-
- name: Install project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- name: Build CLI
run: yarn build:cli # Needed for CLI tests

- name: Test
id: test
run: |
node -v
npm -v
yarn test --silent --selectProjects=@sanity/cli
env:
SANITY_CI_CLI_AUTH_TOKEN: ${{ secrets.SANITY_CI_CLI_AUTH_TOKEN }}
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ jobs:
run: |
node -v
npm -v
yarn test --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }}
yarn test --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} --ignoreProjects=@sanity/cli
env:
# FIXME: re-enable CLI tests with this
# SANITY_CI_CLI_AUTH_TOKEN: ${{ secrets.SANITY_CI_CLI_AUTH_TOKEN }}
GITHUB_SHARD_IDENTIFIER: ${{ matrix.shardIndex }}-${{ matrix.shardTotal }}

cleanup:
Expand Down

2 comments on commit 91d2481

@vercel
Copy link

@vercel vercel bot commented on 91d2481 Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

performance-studio – ./

performance-studio.sanity.build
performance-studio-git-next.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 91d2481 Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio.sanity.build
test-studio-git-next.sanity.build

Please sign in to comment.