Skip to content

Commit c52d458

Browse files
TheWillardclaude
andcommitted
Add CI for Linux and Windows
- Linux: openSUSE Tumbleweed container (GIMP 3), build, clippy, unit and headless GIMP integration tests. - Windows: MSYS2 UCRT64, the toolchain GIMP for Windows is built with. - Both check out arma-tools/gimp-rs next to the plug-in for the ../gimp-rs path dependency and upload the release binary. - Build the plug-in for the Windows GUI subsystem, so no console window opens when GIMP runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4e126c6 commit c52d458

4 files changed

Lines changed: 112 additions & 2 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main, rust-port]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
# The plug-in depends on the gimp-rs bindings via `../gimp-rs`, so both
13+
# repositories are checked out next to each other.
14+
15+
jobs:
16+
linux:
17+
name: Linux
18+
runs-on: ubuntu-latest
19+
# Ubuntu only packages GIMP 2.10, Tumbleweed has GIMP 3.
20+
container: opensuse/tumbleweed
21+
steps:
22+
- name: Install dependencies
23+
run: >
24+
zypper --non-interactive install --no-recommends
25+
gcc git gzip tar curl pkgconf-pkg-config
26+
gimp gimp-devel gimp-plugin-python3
27+
28+
- uses: actions/checkout@v4
29+
with:
30+
path: arma-gimp-plugin
31+
32+
- uses: actions/checkout@v4
33+
with:
34+
repository: ${{ github.repository_owner }}/gimp-rs
35+
path: gimp-rs
36+
37+
- uses: dtolnay/rust-toolchain@stable
38+
with:
39+
components: clippy
40+
41+
- uses: Swatinem/rust-cache@v2
42+
with:
43+
workspaces: arma-gimp-plugin
44+
45+
- name: Build
46+
working-directory: arma-gimp-plugin
47+
run: cargo build --release
48+
49+
- name: Clippy
50+
working-directory: arma-gimp-plugin
51+
run: cargo clippy -- -D warnings
52+
53+
- name: Unit tests
54+
working-directory: arma-gimp-plugin
55+
run: cargo test
56+
57+
- name: GIMP integration tests
58+
working-directory: arma-gimp-plugin
59+
timeout-minutes: 20
60+
run: tests/run-gimp-tests.sh
61+
62+
- uses: actions/upload-artifact@v4
63+
with:
64+
name: arma-gimp-plugin-linux-x86_64
65+
path: arma-gimp-plugin/target/release/arma-gimp-plugin
66+
67+
windows:
68+
name: Windows
69+
runs-on: windows-latest
70+
defaults:
71+
run:
72+
shell: msys2 {0}
73+
steps:
74+
# GIMP on Windows is built with MSYS2 (UCRT64), the plug-in links against
75+
# the same libraries.
76+
- uses: msys2/setup-msys2@v2
77+
with:
78+
msystem: UCRT64
79+
update: true
80+
install: git
81+
pacboy: >-
82+
gcc:p
83+
gimp:p
84+
pkgconf:p
85+
rust:p
86+
87+
- uses: actions/checkout@v4
88+
with:
89+
path: arma-gimp-plugin
90+
91+
- uses: actions/checkout@v4
92+
with:
93+
repository: ${{ github.repository_owner }}/gimp-rs
94+
path: gimp-rs
95+
96+
- name: Build
97+
working-directory: arma-gimp-plugin
98+
run: cargo build --release
99+
100+
- name: Unit tests
101+
working-directory: arma-gimp-plugin
102+
run: cargo test
103+
104+
- uses: actions/upload-artifact@v4
105+
with:
106+
name: arma-gimp-plugin-windows-x86_64
107+
path: arma-gimp-plugin/target/release/arma-gimp-plugin.exe

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ tests/run-gimp-tests.sh
3535
```
3636

3737
runs the plug-in in a headless GIMP with a temporary profile and checks loading
38-
and exporting. The first run is slow while GIMP sets up the profile.
38+
and exporting. CI (`.github/workflows/build.yml`) builds on Linux and Windows
39+
and runs these tests on Linux.
3940

4041
## License
4142

‎src/main.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//! GIMP 3 plug-in for the Arma texture formats: loads PAA (Real Virtuality)
22
//! and EDDS (Enfusion) files and exports PAA files.
33
4+
// GIMP runs plug-ins in the background, without a console window.
5+
#![windows_subsystem = "windows"]
6+
47
mod export;
58
mod load;
69

‎tests/run-gimp-tests.sh‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Runs the plug-in in a headless GIMP with a temporary profile (the user's
33
# GIMP configuration is not touched) and checks loading/exporting.
44
#
5-
# The first run takes a while, GIMP queries all plug-ins of the new profile.
65
# Set GIMP_TEST_DIR to reuse a profile.
76
set -e
87
cd "$(dirname "$0")/.."

0 commit comments

Comments
 (0)