diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0de02b0d693..9192915d4c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,35 +21,17 @@ jobs: command: lint:nofix - name: test command: test --maxWorkers=100% + - name: storybook + command: storybook:ci + - name: chromatic + command: chromatic name: ${{ matrix.config.name }} steps: - uses: actions/checkout@v2 with: - lfs: true - - name: Configure Node.js - uses: actions/setup-node@v2.1.5 - with: - node-version: 15.x - - name: Restore cache - uses: actions/cache@v2.1.4 - with: - path: | - .yarn/cache - **/node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --immutable - - run: yarn run ${{ matrix.config.command }} - - storybook: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2 - with: + fetch-depth: 0 lfs: true - name: Configure Node.js uses: actions/setup-node@v2.1.5 @@ -65,46 +47,22 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- - name: Configure Google Cloud + if: matrix.config.name == 'storybook' uses: google-github-actions/setup-gcloud@v0.2.1 with: service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} export_default_credentials: true - run: yarn install --immutable - - run: yarn run storybook:ci + - run: yarn run ${{ matrix.config.command }} env: + CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref }} + CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} REG_SUIT_GITHUB_CLIENT_ID: ${{ secrets.REG_SUIT_GITHUB_CLIENT_ID }} REG_SUIT_HEAD_SHA: ${{ github.sha }} # `base.sha` works for pull request events, `before` works for pushes to main REG_SUIT_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} - chromatic: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - lfs: true - - name: Configure Node.js - uses: actions/setup-node@v2.1.5 - with: - node-version: 15.x - - name: Restore cache - uses: actions/cache@v2.1.4 - with: - path: | - .yarn/cache - **/node_modules - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --immutable - - run: yarn run chromatic - env: - CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }} - CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref }} - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - integration: runs-on: ${{ matrix.os }} strategy: