Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ViteApp] support for linter, typecheck and ci #696

Merged
merged 14 commits into from
Oct 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: basic action for vite-app
  • Loading branch information
belgattitude committed Oct 27, 2021
commit ef56984fe4969cd7729ec437d7075b92f14dfe2b
88 changes: 88 additions & 0 deletions .github/workflows/ci-vite-app.yml
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