Skip to content

Commit

Permalink
Feature/gh actions - update workflows (#295)
Browse files Browse the repository at this point in the history
* feature/gh-actions - update workflow

* feature/gh-actions - update workflow - lint

* feature/gh-actions - update workflow - code-coverage
  • Loading branch information
garyburgmann authored and vitaliimelnychuk committed Dec 9, 2024
1 parent 95005bf commit 6a19a71
Showing 1 changed file with 76 additions and 10 deletions.
86 changes: 76 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,97 @@ name: CI
on:
push:
branches:
- master
- v1
- "**"
pull_request:

jobs:
checks:
runs-on: ubuntu-latest
install-dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js v20.9.0
uses: actions/setup-node@v1
- uses: actions/checkout@v4

- name: Use NodeJS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: node_modules cache
uses: actions/cache@v4
with:
node-version: v20.9.0
key: node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node_modules-
path: |
./node_modules
- name: Install dependencies
run: yarn

lint:
runs-on: ubuntu-22.04
needs: install-dependencies
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Use NodeJS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: node_modules global cache restore
uses: actions/cache/restore@v4
with:
key: node_modules-${{ hashFiles('**/yarn.lock') }}
fail-on-cache-miss: true
path: |
./node_modules
- name: Run linting checks
run: yarn lint

format-check:
runs-on: ubuntu-22.04
needs: install-dependencies
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Use NodeJS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: node_modules global cache restore
uses: actions/cache/restore@v4
with:
key: node_modules-${{ hashFiles('**/yarn.lock') }}
fail-on-cache-miss: true
path: |
./node_modules
- name: Run formatting checks
run: yarn format-check

- name: Install dependencies
run: yarn test
test-coverage:
runs-on: ubuntu-22.04
needs: install-dependencies
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Use NodeJS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: node_modules global cache restore
uses: actions/cache/restore@v4
with:
key: node_modules-${{ hashFiles('**/yarn.lock') }}
fail-on-cache-miss: true
path: |
./node_modules
- name: Run test coverage
run: yarn coverage
Expand Down

0 comments on commit 6a19a71

Please sign in to comment.