Skip to content

Commit

Permalink
Create lint-and-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
StreakingMan committed Jan 24, 2024
1 parent 699d661 commit 7527249
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: lint and test

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore node_modules from cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
- run: pnpm lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore node_modules from cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
- run: pnpm test:coverage
- uses: codacy/codacy-coverage-reporter-action@v1
if: github.actor != 'dependabot[bot]'
with:
api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports: coverage/lcov.info

1 comment on commit 7527249

@vercel
Copy link

@vercel vercel bot commented on 7527249 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.