Skip to content

build(wireit): wireit for npm scripts #307

build(wireit): wireit for npm scripts

build(wireit): wireit for npm scripts #307

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-20.04
container: cypress/included:8.4.1
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- 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: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: google/wireit@setup-github-actions-caching/v1
- name: Install
run: |
yarn setup |
# https://github.com/cypress-io/github-action/issues/446#issuecomment-968192021
chown -R 1001:1001 /github/home/.cache && echo "pwn dat cache"
- name: Unit tests
run: yarn test:unit -- --coverage --coverageReporters="lcov"
- name: Run codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
continue-on-error: true
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/lcov.info
- name: E2E tests
uses: google/wireit@setup-github-actions-caching/v1
- uses: cypress-io/github-action@v2
timeout-minutes: 30
env:
NODE_OPTIONS: --max-old-space-size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
env: true
command: yarn test:e2e
- uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress
path: cypress