58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
name: Tests and Lint
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [14.x, 15.x, 16.x]
|
|
|
|
name: Node.js ${{ matrix.node-version }}
|
|
|
|
steps:
|
|
- name: Checkout the code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Get the yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- name: Get the cache for yarn
|
|
uses: actions/cache@v2
|
|
id: yarn-cache
|
|
with:
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install the packages
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Lint the framework code
|
|
run: yarn lint
|
|
|
|
- name: Lint the template code
|
|
run: yarn lint
|
|
working-directory: ./packages/dev
|
|
|
|
- name: Build the code
|
|
run: yarn build
|
|
|
|
- name: Run the unit tests
|
|
run: yarn test
|
|
|
|
- name: Run the E2E tests
|
|
run: yarn test-e2e
|