Debian Codegraph @

.github/workflows/main.yaml

raw
1 name: "gir"
2
3 on:
4 pull_request:
5 branches:
6 - "*"
7 push:
8 branches:
9 - "main"
10
11 jobs:
12 hygiene:
13 name: Hygiene
14 runs-on: ${{ matrix.os }}
15 strategy:
16 fail-fast: false
17 matrix:
18 os: [ubuntu-latest]
19 toolchain: [stable]
20
21 defaults:
22 run:
23 shell: bash
24
25 steps:
26 - name: Acquire source code
27 uses: actions/checkout@v6
28 - name: Acquire Rust toolchain
29 uses: actions-rs/toolchain@v1
30 with:
31 toolchain: ${{ matrix.toolchain }}
32 override: true
33 profile: minimal
34 components: rustfmt, clippy
35 id: toolchain
36 - name: Cache cargo registry
37 uses: actions/cache@v5
38 with:
39 path: ~/.cargo/registry
40 key: checks-${{ runner.os }}-cargo-registry-trimmed
41 - name: Cache cargo git trees
42 uses: actions/cache@v5
43 with:
44 path: ~/.cargo/git
45 key: checks-${{ runner.os }}-cargo-gits-trimmed
46 - name: Cache cargo build
47 uses: actions/cache@v5
48 with:
49 path: target
50 key: checks-${{ runner.os }}-cargo-target-dir-${{ steps.toolchain.outputs.rustc_hash }}
51 - name: "Run clippy"
52 uses: actions-rs/cargo@v1
53 with:
54 command: clippy
55 args: --release --tests -- -D warnings
56 if: matrix.os == 'ubuntu-latest'
57 - name: "Run formatting check"
58 uses: actions-rs/cargo@v1
59 with:
60 command: fmt
61 args: -- --check
62 if: matrix.os == 'ubuntu-latest'
63
64 build:
65 name: "Build/Test"
66 runs-on: ${{ matrix.os }}
67 strategy:
68 fail-fast: false
69 matrix:
70 os: [ubuntu-latest]
71 toolchain: [nightly, stable]
72 # include:
73 # - os: windows-latest
74 # toolchain: stable-i686-pc-windows-gnu
75 # bits: 32
76 # arch: i686
77 # - os: windows-latest
78 # toolchain: stable-x86_64-pc-windows-gnu
79 # bits: 64
80 # arch: x86_64
81
82 defaults:
83 run:
84 shell: bash
85
86 steps:
87 - name: Acquire source code
88 uses: actions/checkout@v6
89 - name: Acquire Rust toolchain
90 uses: actions-rs/toolchain@v1
91 with:
92 toolchain: ${{ matrix.toolchain }}
93 override: true
94 profile: minimal
95 id: toolchain
96 - name: Install MSYS2
97 uses: numworks/setup-msys2@v1
98 if: matrix.os == 'windows-latest'
99 - name: Set up MSYS2 path and other windows env
100 run: |
101 echo "::add-path::$RUNNER_TEMP\\msys\\msys64\\usr\\bin"
102 echo "::add-path::$RUNNER_TEMP\\msys\\msys64\\mingw${{ matrix.bits }}\\bin"
103 echo "::set-env name=LIBGIT2_SYS_USE_PKG_CONFIG::1"
104 if: matrix.os == 'windows-latest'
105 - name: Cache cargo registry
106 uses: actions/cache@v5
107 with:
108 path: ~/.cargo/registry
109 key: build-${{ runner.os }}-cargo-registry-trimmed
110 - name: Cache cargo git trees
111 uses: actions/cache@v5
112 with:
113 path: ~/.cargo/git
114 key: build-${{ runner.os }}-cargo-gits-trimmed
115 - name: Cache cargo build
116 uses: actions/cache@v5
117 with:
118 path: target
119 key: build-${{ runner.os }}-cargo-target-dir-${{ steps.toolchain.outputs.rustc_hash }}
120 - name: Install packages from apt
121 run: |
122 sudo apt update
123 sudo apt install libgtk-4-dev libssh2-1-dev libglib2.0-dev libgraphene-1.0-dev libcairo-gobject2 libcairo2-dev
124 if: matrix.os == 'ubuntu-latest'
125 - name: Install toolchain packages with pacman
126 run: pacman --noconfirm -S base-devel mingw-w64-${{ matrix.arch }}-toolchain
127 if: matrix.os == 'windows-latest'
128 - name: Install library devel packages with pacman
129 run: pacman --noconfirm -S mingw-w64-${{ matrix.arch }}-libgit2
130 if: matrix.os == 'windows-latest'
131 - name: "Acquire gir-files"
132 uses: actions/checkout@v6
133 with:
134 repository: gtk-rs/gir-files
135 ref: main
136 path: tests/gir-files
137 - name: "Build (release)"
138 uses: actions-rs/cargo@v1
139 with:
140 command: build
141 args: --release
142 - name: "Test (release)"
143 uses: actions-rs/cargo@v1
144 with:
145 command: test
146 args: --release
147 - name: "Acquire gtk4-rs"
148 uses: actions/checkout@v6
149 with:
150 repository: gtk-rs/gtk4-rs
151 ref: main
152 path: gtk4-rs
153 if: matrix.os == 'ubuntu-latest'
154 - name: "Symlink `gir` in gtk4-rs"
155 run: |
156 rmdir gtk4-rs/gir
157 ln -sf .. gtk4-rs/gir
158 - name: "Attempt to rebuild gtk4-rs gir"
159 run: cd gtk4-rs && python3 generator.py --no-fmt --gir-path ../target/release/gir --gir-files-directories ../tests/gir-files/ && rm ../Cargo.* && cargo build
160 if: matrix.os == 'ubuntu-latest'
161 - name: "Acquire gtk-rs-core"
162 uses: actions/checkout@v6
163 with:
164 repository: gtk-rs/gtk-rs-core
165 ref: main
166 path: gtk-rs-core
167 if: matrix.os == 'ubuntu-latest'
168 - name: "Symlink `gir` in gtk-rs-core"
169 run: |
170 rmdir gtk-rs-core/gir
171 ln -sf .. gtk-rs-core/gir
172 - name: "Rebuild gio"
173 run: cd gtk-rs-core/gio && cargo test
174 if: matrix.os == 'ubuntu-latest'