mirror of https://github.com/lukechilds/polar.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.9 KiB
81 lines
1.9 KiB
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- 'renovate/*'
|
|
- 'release/*'
|
|
- 'ci/*'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
- '!translations'
|
|
- '!renovate/*'
|
|
- '!release/*'
|
|
- '!ci/*'
|
|
types: [assigned, opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
test:
|
|
name: Run tests on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
|
|
|
strategy:
|
|
matrix:
|
|
node_version: [12.x]
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
|
|
steps:
|
|
- name: set git config
|
|
run: |
|
|
git config --global core.eol lf
|
|
git config --global core.autocrlf false
|
|
|
|
- name: ubuntu file watcher tweak
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: setup nodejs
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: install yarn
|
|
run: npm install -g yarn
|
|
|
|
- name: get yarn cache dir
|
|
id: yarn-cache-dir
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v1
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: install dependencies
|
|
run: yarn
|
|
|
|
- name: lint code
|
|
run: yarn lint
|
|
|
|
- name: typescript compile
|
|
run: yarn tsc
|
|
|
|
- name: unit tests
|
|
run: yarn test:ci
|
|
|
|
- name: coverage
|
|
uses: codecov/codecov-action@v1
|
|
|
|
- name: electron build
|
|
run: yarn package:ci
|
|
if: startsWith(github.ref, 'refs/heads/release/')
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|