Files
pnpm/.github/workflows/ci.yml
2021-11-15 01:17:45 +00:00

51 lines
1.3 KiB
YAML

name: CI
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
node:
- '12.17'
- '14'
- '16'
- '17'
platform:
- ubuntu-latest
- windows-latest
- macos-latest
name: '${{matrix.platform}} / Node.js ${{ matrix.node }}'
runs-on: ${{matrix.platform}}
steps:
- name: Configure Git
run: |
git config --global core.autocrlf false
git config --global user.name "xyz"
git config --global user.email "x@y.z"
- name: Checkout Commit
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: checkout main
run: git branch -f main origin/main
- name: install pnpm and npm
run: |
${{ runner.os == 'Windows' && '$PSStyle.OutputRendering = "Ansi"' || '' }}
curl -L https://get.pnpm.io/v6.16.js | node - add --global pnpm@next npm@7
- name: pnpm install
run: pnpm install
- name: Audit
run: pnpm audit
- name: run tests (main)
if: github.ref == 'refs/heads/main'
run: pnpm run test-main
- name: run tests (branch)
if: github.ref != 'refs/heads/main'
run: pnpm run test-branch