Skip to content

setup yarn cache in Github Actions #702

setup yarn cache in Github Actions

setup yarn cache in Github Actions #702

Workflow file for this run

name: Node CI
on:
pull_request:
paths-ignore:
- 'nuxt/**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- run: yarn --network-timeout 100000
- run: yarn lint
- name: Type check
run: |
yarn typeCheck
test:
runs-on: ${{ matrix.os }}
env:
DISPLAY: :99.0
strategy:
matrix:
node-version: [14.x]
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install xvfb
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y xvfb graphicsmagick
npm install -g xvfb-maybe
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- run: yarn --network-timeout 100000
- run: yarn unit
- run: yarn e2e
- name: Upload screenshots
if: failure()
uses: actions/[email protected]
with:
# Artifact name
name: ${{ matrix.os }}-screenshots
# Directory containing files to upload
path: screenshots
build:
runs-on: ${{ matrix.os }}
# Platforms to build on/for
strategy:
max-parallel: 2
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- run: yarn --network-timeout 100000
- name: Build Electron app
shell: bash
env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max-old-space-size=4096
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: yarn build --publish never
- name: Upload artifact
uses: actions/[email protected]
with:
# Artifact name
name: ${{ matrix.os }}-artifact
# Directory containing files to upload
path: dist_electron