-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20dfc5d
commit 958e5d4
Showing
1 changed file
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |