Skip to content

Commit

Permalink
Merge pull request #917 from blockscout/optimize-workflow-run
Browse files Browse the repository at this point in the history
"Check" workflow enhancements
  • Loading branch information
tom2drum authored Jun 16, 2023
2 parents 0c8394f + 62cbcfd commit fc1cb04
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,36 @@ name: Checks
on:
workflow_dispatch:
pull_request:
types: [ opened, synchronize, unlabeled ]
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.husky/**'
- '.vscode/**'
- 'deploy/**'
- 'docs/**'
- 'public/**'
- 'stub/**'
push:
branches:
- main
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- '.husky/**'
- '.vscode/**'
- 'deploy/**'
- 'docs/**'
- 'public/**'
- 'stub/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: ESLint
code_quality:
name: Code quality
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'WIP')"
if: ${{ !contains(github.event.pull_request.labels.*.name, 'WIP') && !(github.event.action == 'unlabeled' && github.event.label.name != 'WIP') }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
Expand All @@ -29,31 +50,12 @@ jobs:
- name: Run ESLint
run: yarn lint:eslint

type_check:
name: TypeScript
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'WIP')"
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
useRollingCache: true

- name: Compile TypeScript
run: yarn lint:tsc

jest_tests:
name: Run unit tests with Jest
needs: [ lint, type_check ]
needs: [ code_quality ]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand All @@ -75,10 +77,10 @@ jobs:

pw_tests:
name: Run components visual tests with PlayWright
needs: [ lint, type_check ]
needs: [ code_quality ]
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.28.0-focal
image: mcr.microsoft.com/playwright:v1.32.0-focal

steps:
- name: Install git-lfs
Expand Down

0 comments on commit fc1cb04

Please sign in to comment.