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 8157b75 commit 281ee67
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 9 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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

- 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 }}

40 changes: 40 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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

- 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
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: test

on:
push:
Expand All @@ -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 @@ -42,10 +42,5 @@ jobs:
- name: Install dependencies
run: pnpm install --ignore-scripts

- name: Linter
run: pnpm run format:ci

- name: Test
run: pnpm test


0 comments on commit 281ee67

Please sign in to comment.