Skip to content

Commit e762612

Browse files
committed
use nx to run ci commands
1 parent 42ce64e commit e762612

1 file changed

Lines changed: 36 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,31 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21+
- name: Install Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
2126
- name: Install rustfmt and clippy
2227
run: |
2328
rustup component add rustfmt clippy
2429
30+
- name: Cache npm dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.npm
34+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
- name: Cache Nx
39+
uses: actions/cache@v4
40+
with:
41+
path: .nx
42+
key: ${{ runner.os }}-nx-${{ github.sha }}
43+
restore-keys: |
44+
${{ runner.os }}-nx-
45+
2546
- name: Cache cargo dependencies
2647
uses: actions/cache@v4
2748
with:
@@ -35,17 +56,26 @@ jobs:
3556
restore-keys: |
3657
${{ runner.os }}-cargo-
3758
38-
- name: Download dependencies
59+
- name: Install npm dependencies
60+
run: npm ci
61+
62+
- name: Add node_modules/.bin to PATH
63+
run: echo "$PWD/node_modules/.bin" >> "$GITHUB_PATH"
64+
65+
- name: Verify Nx installation
66+
run: nx --version
67+
68+
- name: Download cargo dependencies
3969
run: cargo fetch --locked
4070

4171
- name: Check formatting
42-
run: cargo fmt -- --check
72+
run: nx run cigen:format -- -- --check
4373

44-
- name: Run clippy
45-
run: cargo clippy --all-targets --all-features -- -D warnings
74+
- name: Run linting
75+
run: nx run cigen:lint
4676

4777
- name: Run tests
48-
run: cargo test --verbose
78+
run: nx run cigen:test
4979

5080
- name: Build
51-
run: cargo build --verbose
81+
run: nx run cigen:build

0 commit comments

Comments
 (0)