Skip to content

Commit

Permalink
👷 Split lint-and-test into "lint" and "test" (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 authored Jan 19, 2024
1 parent 6c70a72 commit c706027
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 12 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Lint
on:
pull_request:
push:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
with:
# Could use something like rmacklin/fetch-through-merge-base@v0 instead when the repo gets bigger
fetch-depth: 0
- name: "Extracting the merge base into 'SINCE'"
id: since
run: |
if [ -z "${{ github.event.pull_request.head.ref }}" ]
then
echo "SINCE=${{ github.sha }}^1" >> $GITHUB_OUTPUT
else
echo "SINCE=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})" >> $GITHUB_OUTPUT
fi
- run: corepack enable

- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- run: |
pnpm install --frozen-lockfile --filter .
pnpm install --frozen-lockfile --filter ...[${{ steps.since.outputs.SINCE }}]...
pnpm --filter ...[${{ steps.since.outputs.SINCE }}]... build
- name: "Checking lint errors"
run: |
pnpm --filter ...[${{ steps.since.outputs.SINCE }}] lint:check
- name: "Checking format errors"
run: |
pnpm --filter ...[${{ steps.since.outputs.SINCE }}] format:check
- name: Check types
run: pnpm --filter ...[${{ steps.since.outputs.SINCE }}] check
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Lint and test
name: Test
on:
pull_request:
push:
branches:
- main

jobs:
lint:
test:
runs-on: ubuntu-latest
timeout-minutes: 10

Expand Down Expand Up @@ -36,16 +36,6 @@ jobs:
pnpm install --frozen-lockfile --filter .
pnpm install --frozen-lockfile --filter ...[${{ steps.since.outputs.SINCE }}]...
pnpm --filter ...[${{ steps.since.outputs.SINCE }}]... build
- name: "Checking lint errors"
run: |
pnpm --filter ...[${{ steps.since.outputs.SINCE }}] lint:check
- name: "Checking format errors"
run: |
pnpm --filter ...[${{ steps.since.outputs.SINCE }}] format:check
- name: Check types
run: pnpm --filter ...[${{ steps.since.outputs.SINCE }}] check
- name: Test
run: VCR_MODE=playback pnpm --filter ...[${{ steps.since.outputs.SINCE }}] test
Expand Down

0 comments on commit c706027

Please sign in to comment.