Skip to content

Commit d169a00

Browse files
feat(ci): add act configuration for local GitHub Actions testing
Add `.actrc` configuration: - Map custom self-hosted runners (macOS, ARM64, studio) to -self-hosted - Use catthehacker/ubuntu:act-latest for ubuntu-latest - Set ARM64 architecture and enable container reuse Add `test-local.yml` workflow: - act-compatible linting workflow (no node24 runtime issues) - Installs Deno directly instead of using problematic GitHub Actions - Runs Deno fmt and lint checks successfully Add ACT_GUIDE.md: - Quick start commands and troubleshooting - Explains node24 runtime limitations in current act version - Documents platform mappings and common issues Tested successfully with: act -W .github/workflows/test-local.yml -j lint Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 8b00c12 commit d169a00

3 files changed

Lines changed: 159 additions & 0 deletions

File tree

‎.actrc‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# act configuration for local GitHub Actions testing
2+
# Ref: https://nektosact.com/
3+
4+
# Map custom self-hosted runners to run natively (no Docker)
5+
-P macOS=-self-hosted
6+
-P ARM64=-self-hosted
7+
-P studio=-self-hosted
8+
9+
# Use smaller images for Ubuntu jobs to avoid Docker Hub rate limits
10+
-P ubuntu-latest=catthehacker/ubuntu:act-latest
11+
12+
# Set architecture to match host (Apple Silicon)
13+
--container-architecture=linux/arm64
14+
15+
# Reuse containers for faster subsequent runs
16+
--reuse
17+
18+
# Show verbose output for debugging
19+
--verbose

‎.github/ACT_GUIDE.md‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Local GitHub Actions Testing with act
2+
3+
## Quick Reference
4+
5+
```bash
6+
# Run lint checks (fastest, fully compatible)
7+
act -W .github/workflows/test-local.yml -j lint
8+
9+
# List all available workflows and jobs
10+
act -l
11+
12+
# Run specific workflow
13+
act -W .github/workflows/test-local.yml
14+
```
15+
16+
## Why test-local.yml?
17+
18+
The `test-local.yml` workflow is designed for act compatibility:
19+
20+
- ✅ No node24 runtime issues (skips problematic GitHub Actions)
21+
- ✅ Installs tools directly (Deno, etc.)
22+
- ✅ Fast feedback loop
23+
- ✅ Works in Docker containers
24+
25+
The main `test.yml` workflow uses newer GitHub Actions that require node24 runtime, which act doesn't support yet.
26+
27+
## Configuration
28+
29+
The `.actrc` file handles platform mappings:
30+
31+
```bash
32+
# Self-hosted runners run natively (no Docker)
33+
-P macOS=-self-hosted
34+
-P ARM64=-self-hosted
35+
-P studio=-self-hosted
36+
37+
# Ubuntu runs in Docker
38+
-P ubuntu-latest=catthehacker/ubuntu:act-latest
39+
40+
# Match host architecture
41+
--container-architecture=linux/arm64
42+
43+
# Reuse containers for speed
44+
--reuse
45+
```
46+
47+
## Common Issues
48+
49+
### Node24 Runtime Error
50+
51+
If you see: `The runs.using key in action.yml must be one of: [composite docker node12 node16 node20], got node24`
52+
53+
**Solution:** Use `test-local.yml` instead of `test.yml`
54+
55+
### Docker Authentication Errors
56+
57+
```bash
58+
# Clear stale Docker credentials
59+
rm ~/.docker/config.json
60+
docker logout
61+
```
62+
63+
### Self-Hosted Runner Warnings
64+
65+
Jobs with `runs-on: [macOS, ARM64]` or `runs-on: studio` will run on your machine natively. This is expected behavior defined in `.actrc`.
66+
67+
## Resources
68+
69+
- [act Documentation](https://nektosact.com)
70+
- [act GitHub](https://github.com/nektos/act)

‎.github/workflows/test-local.yml‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test Suite (Local)
2+
3+
# Simplified workflow for local testing with act
4+
# Use: act -W .github/workflows/test-local.yml -j lint
5+
6+
on:
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
# Linting and code quality (act-compatible, no setup actions)
12+
lint:
13+
name: Lint and Format Check
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v6
19+
20+
- name: Install Deno
21+
run: |
22+
curl -fsSL https://deno.land/install.sh | sh
23+
echo "$HOME/.deno/bin" >> $GITHUB_PATH
24+
25+
- name: Check Deno formatting
26+
run: $HOME/.deno/bin/deno fmt --check
27+
28+
- name: Run Deno lint
29+
run: $HOME/.deno/bin/deno lint
30+
31+
# Vitest unit tests
32+
vitest-tests:
33+
name: Vitest Unit Tests
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 10
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v6
40+
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v5
43+
with:
44+
node-version: '20'
45+
cache: 'npm'
46+
cache-dependency-path: app/frontend/package-lock.json
47+
48+
- name: Install frontend dependencies
49+
working-directory: ./app/frontend
50+
run: npm ci
51+
52+
- name: Run Vitest with coverage
53+
working-directory: ./app/frontend
54+
run: npm run test:coverage
55+
continue-on-error: true
56+
57+
# Clippy check (Rust linting)
58+
clippy:
59+
name: Rust Clippy
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v6
65+
66+
- name: Setup Rust
67+
uses: dtolnay/rust-toolchain@stable
68+
69+
- name: Run Clippy
70+
run: cargo clippy --workspace

0 commit comments

Comments
 (0)