Skip to content

Commit

Permalink
Merge pull request #15 from vbudovski/feature/husky
Browse files Browse the repository at this point in the history
Feature/husky
  • Loading branch information
vbudovski authored Jan 2, 2025
2 parents ebe9b38 + 4f707c0 commit ffb0d5c
Show file tree
Hide file tree
Showing 13 changed files with 524 additions and 159 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint

on: workflow_call

jobs:
unit:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Deno
uses: denoland/setup-deno@v2

- name: Get pnpm store directory
id: deno-cache
shell: bash
run: |
echo "DENO_DIR=$(deno info | grep DENO_DIR | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | cut -d ':' -f 2 | xargs)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup Deno cache
with:
path: ${{ steps.deno-cache.outputs.DENO_DIR }}
key: ${{ runner.os }}-deno-cache
restore-keys: |
${{ runner.os }}-deno-cache
- name: Biome CI
id: biome-ci
run: |
deno task ci
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
lint:
uses: ./.github/workflows/lint.yml

test:
needs: lint
uses: ./.github/workflows/test.yml
secrets:
GIST_SECRET: ${{ secrets.GIST_SECRET }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run tests
id: tests
run: |
cd paseri-lib && deno test --coverage
deno test --coverage
echo "CODE_COVERAGE=$(deno coverage | grep "All files" | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' | cut -d '|' -f 2 | xargs)" >> $GITHUB_OUTPUT
echo "GIST_PATH=$(echo "${{ github.repository }}/${{ github.ref_name }}" | sed 's/\//_/g')-coverage.svg" >> $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deno task lint-staged
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"files": {
"ignore": ["dist"]
"ignore": [".astro"]
},
"organizeImports": {
"enabled": true
Expand Down
10 changes: 10 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tasks": {
"init": "deno run --allow-env --allow-read --allow-write --allow-run npm:husky",
"lint-staged": "deno run --allow-env --allow-read --allow-write --allow-sys --allow-run npm:lint-staged",
"ci": "deno run --allow-env --allow-read --allow-run npm:@biomejs/biome ci",
"check": "deno run --allow-env --allow-read --allow-run npm:@biomejs/biome check"
},
"workspace": ["paseri-lib"],
"nodeModulesDir": "auto"
}
Loading

0 comments on commit ffb0d5c

Please sign in to comment.