Merge pull request #142 from luke-h1/chore/update-actions #352
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
NODE_VERSION: 20.10.0 | |
PNPM_VERSION: 9.0.6 | |
jobs: | |
build: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
checks: write | |
timeout-minutes: 20 | |
steps: | |
- name: Install moreutils | |
run: sudo apt install moreutils | |
# https://github.com/actions/virtual-environments/issues/1187 | |
- name: tune linux network | |
run: sudo ethtool -K eth0 tx off rx off | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Setup Node | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- uses: actions/labeler@v4 | |
with: | |
sync-labels: true | |
- name: Install dependencies | |
run: pnpm i | |
- name: Check commit message | |
run: pnpm commitlint --from=HEAD^1 | |
- name: format:check | |
run: pnpm format:check | |
- name: lint | |
run: pnpm lint | |
- name: jest | |
run: pnpm test | |
- name: Coverage | |
uses: ArtiomTr/jest-coverage-report-action@v2 | |
id: coverage | |
with: | |
skip-step: install | |
package-manager: pnpm | |
test-script: pnpm test:coverage | |
output: report-markdown | |
- name: Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
message: ${{ steps.coverage.outputs.report }} | |
- name: tsc | |
run: pnpm tsc |