diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..e941ec8f4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/test.yml similarity index 89% rename from .github/workflows/lint-and-test.yml rename to .github/workflows/test.yml index ec2ac33ff..42a019081 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Lint and test +name: Test on: pull_request: push: @@ -6,7 +6,7 @@ on: - main jobs: - lint: + test: runs-on: ubuntu-latest timeout-minutes: 10 @@ -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