Skip to content

Commit

Permalink
build: improve github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Sep 9, 2022
1 parent 6f0ca4f commit b998356
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 5 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: coverage

on:
push:
branches:
- main
pull_request:
branches:
- main

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: true

- name: Install dependencies
run: pnpm install --ignore-scripts

- name: Coverage
run: pnpm run test:coverage

- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

42 changes: 42 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: linter

on:
push:
branches:
- main
pull_request:
branches:
- main

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: true

- name: Install dependencies
run: pnpm install --ignore-scripts

- name: Linter
run: pnpm run format:ci
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ concurrency:
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
build:
strategy:
matrix:
node-version: [14, 16, 18]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
node-version: ${{ matrix.node-version }}

- uses: pnpm/action-setup@v2.2.2
name: Install pnpm
Expand All @@ -47,5 +47,3 @@ jobs:

- name: Test
run: pnpm test


0 comments on commit b998356

Please sign in to comment.