|
| 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 |
0 commit comments