Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
- Implements caching of node_modules
- Adds a workflow for checking for circular dependencies
- Changes naming of workflows to be more clear
  • Loading branch information
ArchangelWTF committed Feb 9, 2025
1 parent 9ef7c02 commit 60c5e7a
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/check_circular.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check for circular dependencies

on:
workflow_dispatch:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'

jobs:
check-circular:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: "npm"
cache-dependency-path: "package.json"

- name: Check CI cache
id: check-cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('./package.json') }}
- name: Install dependencies
if: steps.check-cache.outputs.cache-hit != 'true'
run: npm install

- name: Type check
run: npm run check-types

16 changes: 14 additions & 2 deletions .github/workflows/check_types.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Type Check
name: Check typing

on:
workflow_dispatch:
Expand All @@ -10,7 +10,7 @@ on:
- '**/*.md'

jobs:
test:
check-types:
runs-on: ubuntu-latest

steps:
Expand All @@ -21,8 +21,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '22'
cache: "npm"
cache-dependency-path: "package.json"

- name: Check CI cache
id: check-cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('./package.json') }}
- name: Install dependencies
if: steps.check-cache.outputs.cache-hit != 'true'
run: npm install

- name: Type check
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Code Linter
name: Verify code style

on:
workflow_dispatch:
Expand All @@ -10,7 +10,7 @@ on:
- '**/*.md'

jobs:
test:
lint:
runs-on: ubuntu-latest

steps:
Expand All @@ -21,8 +21,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '22'
cache: "npm"
cache-dependency-path: "package.json"

- name: Check CI cache
id: check-cache
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('./package.json') }}
- name: Install dependencies
if: steps.check-cache.outputs.cache-hit != 'true'
run: npm install

- name: Code lint
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"setup": "npm i",
"lint": "npx @biomejs/biome lint ./",
"check-types": "npx tsc -noEmit -p tsconfig.types.json",
"check-circular": "madge --circular --ts-config tsconfig.json --extensions ts ./src/",
"build": "node ./build.mjs",
"buildinfo": "node ./build.mjs --verbose"
},
Expand All @@ -19,8 +20,9 @@
"ignore": "^5.2",
"tsyringe": "~4.8",
"typescript": "5.7.3",
"winston": "~3.13"
"winston": "~3.13",
"madge": "8.0.0"
},
"author": "Fika",
"license": "CC-BY-NC-SA-4.0"
}
}

0 comments on commit 60c5e7a

Please sign in to comment.