Skip to content

Commit

Permalink
ci: skip entire job instead of steps (#6312)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Aug 9, 2024
1 parent fc19095 commit 3c04fdc
Showing 1 changed file with 27 additions and 36 deletions.
63 changes: 27 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: macos-14
steps:
- uses: actions/checkout@v4

Expand All @@ -32,7 +32,27 @@ jobs:
- name: Lint
run: pnpm run lint

changed:
runs-on: macos-14
outputs:
should_skip: ${{ steps.changed-files.outputs.only_changed == 'true' }}

steps:
- uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c # v44.5.7
with:
files: |
docs/**
.github/**
!.github/workflows/ci.yml
**.md
test:
needs: changed
if: needs.changed.outputs.should_skip != 'true'
runs-on: ${{ matrix.os }}

timeout-minutes: 30
Expand All @@ -54,49 +74,34 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c # v44.5.7
with:
files: |
docs/**
.github/**
!.github/workflows/ci.yml
**.md
- uses: ./.github/actions/setup-and-cache
if: steps.changed-files.outputs.only_changed != 'true'
with:
node-version: ${{ matrix.node_version }}

- uses: browser-actions/setup-chrome@v1
if: steps.changed-files.outputs.only_changed != 'true'

- name: Install
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm i

- name: Install Playwright Dependencies
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm exec playwright install chromium --with-deps

- name: Build
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run build

- name: Test
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run test:ci

- name: Test Examples
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run test:examples

- name: Unit Test UI
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run -C packages/ui test:ui

test-browser:
needs: changed
if: needs.changed.outputs.should_skip != 'true'

runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -114,46 +119,32 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c # v44.5.7
with:
files: |
docs/**
.github/**
!.github/workflows/ci.yml
**.md
- uses: ./.github/actions/setup-and-cache
if: steps.changed-files.outputs.only_changed != 'true'
with:
node-version: 20

- uses: browser-actions/setup-chrome@v1
if: ${{ steps.changed-files.outputs.only_changed != 'true' && matrix.browser[0] == 'chromium' }}
if: ${{ matrix.browser[0] == 'chromium' }}
- uses: browser-actions/setup-firefox@v1
if: ${{ steps.changed-files.outputs.only_changed != 'true' && matrix.browser[0] == 'firefox' }}
if: ${{ matrix.browser[0] == 'firefox' }}

- name: Install
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm i

- name: Install Playwright Dependencies
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm exec playwright install ${{ matrix.browser[0] }} --with-deps

- name: Build
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run build

- name: Test Browser (playwright)
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run test:browser:playwright
env:
BROWSER: ${{ matrix.browser[0] }}

- name: Test Browser (webdriverio)
run: pnpm run test:browser:webdriverio
if: ${{ steps.changed-files.outputs.only_changed != 'true' && matrix.browser[1] }}
if: ${{ matrix.browser[1] }}
env:
BROWSER: ${{ matrix.browser[1] }}

0 comments on commit 3c04fdc

Please sign in to comment.