Skip to content

Commit

Permalink
Split CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbouchenoire committed Aug 5, 2021
1 parent 20dfc5d commit 958e5d4
Showing 1 changed file with 78 additions and 9 deletions.
87 changes: 78 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,91 @@
name: CI
on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main]
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
cache:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout commit
uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: "14"
cache: "yarn"
- name: Cache dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
- name: Run linting
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: yarn install --force --non-interactive --ignore-scripts
lint:
runs-on: ubuntu-latest
needs: cache
steps:
- name: Checkout commit
uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Lint files
run: yarn lint
test:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: cache
steps:
- name: Checkout commit
uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Run tests
run: yarn test
build:
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- name: Checkout commit
uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Restore dependencies
uses: actions/cache@v2
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Run build
run: yarn build

0 comments on commit 958e5d4

Please sign in to comment.