-
-
Notifications
You must be signed in to change notification settings - Fork 113
179 lines (173 loc) · 6.19 KB
/
CI.yml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
name: CI
jobs:
build:
name: ${{matrix.conf.name}} (rust ${{matrix.rust}})
runs-on: ubuntu-latest
container:
image: ghcr.io/gtk-rs/gtk-rs-core/core:latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
- "1.65.0"
conf:
- { name: "cairo", features: "png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface", nightly: "--features 'png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface'", test_sys: true }
- { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true }
- { name: "gio", features: "v2_78", nightly: "--all-features", test_sys: true }
- { name: "glib", features: "v2_78", nightly: "--all-features", test_sys: true }
- { name: "graphene", features: "", nightly: "", test_sys: true }
- { name: "pango", features: "v1_50", nightly: "--all-features", test_sys: true }
- { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true }
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- uses: actions/checkout@v3
with:
repository: gtk-rs/checker
ref: master
path: checker
if: matrix.rust == 'nightly'
# nightly
# files checks
- run: cargo build --release
working-directory: checker
if: matrix.rust == 'nightly'
- run: cargo run --release -- --no-manual-traits ../${{matrix.conf.name}}
working-directory: checker
if: matrix.rust == 'nightly' && matrix.conf.name == 'cairo'
- run: cargo run --release -- ../${{matrix.conf.name}}
working-directory: checker
if: matrix.rust == 'nightly' && matrix.conf.name != 'cairo'
- run: cargo run --release -- --no-license ../${{matrix.conf.name}}/sys
working-directory: checker
if: matrix.rust == 'nightly' && matrix.conf.name != 'cairo'
- run: cargo run --release -- --no-manual-traits ../glib-macros
working-directory: checker
if: matrix.rust == 'nightly' && matrix.conf.name == 'glib'
- name: Check doc aliases
run: |
python3 doc_aliases.py ../${{matrix.conf.name}}
cd .. && git config --global --add safe.directory `pwd` && git diff --exit-code
working-directory: checker
if: matrix.rust == 'nightly'
# tests run
- name: build nightly
run: cargo build --manifest-path ${{ matrix.conf.name }}/Cargo.toml ${{ matrix.conf.nightly }}
if: matrix.rust == 'nightly'
# not nightly
# clippy
- run: rustup component add clippy
if: matrix.rust == 'beta' || matrix.rust == 'stable'
- working-directory: ${{ matrix.conf.name }}
name: clippy ${{ matrix.conf.name }}
run: cargo clippy --all-targets
if: matrix.rust == 'beta'
- working-directory: ${{ matrix.conf.name }}
name: clippy ${{ matrix.conf.name }}
run: cargo clippy --all-targets -- -D warnings
if: matrix.rust == 'stable'
# tests
- name: build
run: cargo build --manifest-path ${{ matrix.conf.name }}/Cargo.toml --features "${{ matrix.conf.features }}"
if: matrix.rust != 'nightly'
- name: tests
run: cargo test --manifest-path ${{ matrix.conf.name }}/Cargo.toml --features "${{ matrix.conf.features }}"
if: matrix.rust != 'nightly'
- name: Test ${{ matrix.conf.name }}/sys
run: cargo test
working-directory: ${{ matrix.conf.name }}/sys
if: matrix.conf.test_sys
# GLib compile tests only on stable
- name: Compile tests
run: cargo test --manifest-path glib/Cargo.toml --features "compiletests,v2_78"
if: matrix.rust == 'stable'
build-others:
runs-on: ubuntu-latest
container:
image: ghcr.io/gtk-rs/gtk-rs-core/core:latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
- "1.65.0"
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
# glib-macros
- name: "glib-macros: build"
run: cargo build --manifest-path glib-macros/Cargo.toml
- name: "glib-macros: test"
run: cargo test --manifest-path glib-macros/Cargo.toml
# glib-macros in 2 levels dependent
- name: Check two levels glib dependent
run: cargo check
working-directory: tests/two-levels-glib-dependent
- name: "glib-build-tools: build"
run: cargo build --manifest-path glib-build-tools/Cargo.toml
# examples
- name: "examples"
run: cargo build --manifest-path examples/Cargo.toml --bins --examples --all-features
fmt:
name: rust fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
generator:
name: regen check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
set-safe-directory: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: git submodule update --checkout
- run: python3 generator.py
- run: git diff --exit-code
docs:
name: docs embed check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
set-safe-directory: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: git submodule update --checkout
- run: cargo install rustdoc-stripper
- run: python3 generator.py --embed-docs
- run: python3 generator.py --strip-docs
- run: git diff --exit-code