-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (128 loc) · 3.82 KB
/
ci.yml
File metadata and controls
144 lines (128 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI
on:
push:
branches:
- main
paths:
- "src/**"
- "lib/**"
- "scripts/**"
- "tests/**"
- "Cargo.toml"
- "Cargo.lock"
- "package.json"
- "pnpm-lock.yaml"
- "build.rs"
- "deno.json"
- "deno.lock"
- "tsconfig*.json"
- "Taskfile.yml"
- "rust-toolchain.toml"
- ".github/workflows/ci.yml"
pull_request:
branches:
- main
paths:
- "src/**"
- "lib/**"
- "scripts/**"
- "tests/**"
- "Cargo.toml"
- "Cargo.lock"
- "package.json"
- "pnpm-lock.yaml"
- "build.rs"
- "deno.json"
- "deno.lock"
- "tsconfig*.json"
- "Taskfile.yml"
- "rust-toolchain.toml"
- ".github/workflows/ci.yml"
jobs:
build-and-test:
name: Build and Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Linux
- os: macos-latest
name: macOS
- os: windows-latest
name: Windows
env:
PRINTERS_JS_SIMULATE: true # Force simulation mode for all tests
CARGO_TERM_COLOR: always
permissions: {}
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v6
# Linux-specific setup
- name: Disable man-db auto-update and install CUPS libraries (Linux)
if: runner.os == 'Linux'
run: |
echo "man-db man-db/auto-update boolean false" | sudo debconf-set-selections
sudo rm -f /var/lib/man-db/auto-update
sudo apt-get update
sudo apt-get install -y libcups2-dev pkg-config clang
# Setup Rust toolchain for building native library
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
# Cache Rust dependencies for faster builds
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.os }}-rust
# Install cargo-llvm-cov for code coverage (Linux only)
# Coverage artifacts only uploaded from Linux to avoid duplicates
- name: Install cargo-llvm-cov (Linux only)
if: runner.os == 'Linux'
uses: taiki-e/install-action@cargo-llvm-cov
# Setup Deno
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
# Setup Bun
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Task runner
uses: go-task/setup-task@v2
# Enable Corepack for pnpm (version pinned in package.json packageManager field)
- name: Enable Corepack
run: corepack enable
# Setup Node.js (version pinned in .node-version)
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: pnpm
# Install Node.js dependencies
- name: Install Node.js dependencies
run: pnpm install --frozen-lockfile
# Build all runtime libraries (includes compilation)
- name: Build all runtime libraries
run: task build
# Run comprehensive cross-runtime tests (includes Rust, Deno, Node.js, Bun)
# This generates JUnit XML and LCOV coverage for all runtimes
- name: Run cross-runtime tests
id: cross-runtime-tests
run: task test
- name: Upload Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: test-reports-${{ matrix.name }}
path: test-results/*.xml
if-no-files-found: ignore
- name: Upload Coverage Reports (Linux only)
if: ${{ always() && runner.os == 'Linux' }}
uses: actions/upload-artifact@v7
with:
name: coverage-reports
path: test-results/coverage/*
if-no-files-found: ignore