-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
4dd18c4
commit ef56984
Showing
1 changed file
with
88 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: CI-vite-app | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
paths: | ||
- "apps/vite-app/**" | ||
- "packages/**" | ||
- "package.json" | ||
- "yarn.lock" | ||
- ".yarnrc.yml" | ||
- "*.base.json" | ||
- "*.base.js" | ||
- ".github/workflows/**" | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- "apps/vite-app/**" | ||
- "packages/**" | ||
- "package.json" | ||
- "yarn.lock" | ||
- ".yarnrc.yml" | ||
- "*.base.json" | ||
- "*.base.js" | ||
- ".prettier*.*" | ||
- ".github/workflows/**" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
# Why not using setup-node 2.2+ cache option (yet) ? | ||
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} | ||
restore-keys: | | ||
yarn-cache-folder- | ||
- name: Install dependencies | ||
run: | | ||
yarn install --immutable | ||
- name: Typecheck | ||
working-directory: apps/vite-app | ||
run: | | ||
yarn typecheck | ||
- name: Linter | ||
working-directory: apps/vite-app | ||
run: | | ||
yarn lint --cache | ||
- name: Unit tests | ||
working-directory: apps/vite-app | ||
run: | | ||
yarn ci-test:unit | ||
- name: Build vite-app | ||
working-directory: apps/vite-app | ||
run: | | ||
yarn build | ||