7
7
pull_request :
8
8
9
9
jobs :
10
- black-lint :
10
+ python-fmt :
11
11
runs-on : ubuntu-latest
12
12
steps :
13
- - uses : actions/checkout@v2
14
- - uses : psf/black@stable
13
+ - name : Check out repository code
14
+ uses : actions/checkout@v2
15
+ -
uses :
prefix-dev/[email protected]
15
16
with :
16
- options : " --check "
17
- jupyter : true
18
- src : " ./vl-convert-python "
17
+ pixi-version : v0.28.2
18
+ - name : Check cargo fmt compliance
19
+ run : pixi run fmt-py-check
19
20
20
21
rust-fmt-clippy :
21
22
runs-on : ubuntu-latest
@@ -24,43 +25,54 @@ jobs:
24
25
steps :
25
26
- name : Check out repository code
26
27
uses : actions/checkout@v2
27
- - name : Install latest stable Rust toolchain
28
- uses : actions-rs/toolchain@v1
28
+ -
uses :
prefix-dev/[email protected]
29
29
with :
30
- toolchain : stable
31
- override : true
32
- components : rustfmt, clippy
30
+ pixi-version : v0.28.2
33
31
- name : Cache rust dependencies
34
32
uses : Swatinem/rust-cache@v2
35
33
with :
36
34
cache-on-failure : True
37
- - name : Install Protoc
38
- uses : arduino/setup-protoc@v2
39
- with :
40
- repo-token : ${{ secrets.GITHUB_TOKEN }}
41
35
- name : Check cargo fmt compliance
42
- run : cargo fmt --all -- - -check
36
+ run : pixi run fmt-rs -check
43
37
- name : Check no rustc warnings
44
- run : cargo check --tests
38
+ run : pixi run check-rs
45
39
- name : Check for clippy warnings
46
- run : cargo clippy
40
+ run : pixi run clippy
47
41
48
42
cargo-bundle-license :
49
43
runs-on : ubuntu-latest
50
44
steps :
51
45
- name : Check out repository code
52
46
uses : actions/checkout@v2
53
- - name : Install latest stable Rust toolchain
54
- uses : actions-rs/toolchain@v1
47
+ -
uses :
prefix-dev/[email protected]
55
48
with :
56
- toolchain : stable
57
- override : true
58
- - name : Install cargo bundle license
59
- run : cargo install cargo-bundle-licenses
49
+ pixi-version : v0.28.2
60
50
- name : Check that license is up to date
61
- run : cargo bundle-licenses --format yaml --output CI.yaml --previous thirdparty_rust.yaml --check-previous
51
+ run : pixi run bundle-licenses
52
+ - name : Check that git detects no file changes
53
+ run : git diff --exit-code
62
54
63
55
codegen-clean :
56
+ runs-on : ubuntu-latest
57
+ steps :
58
+ - name : Check out repository code
59
+ uses : actions/checkout@v2
60
+ -
uses :
prefix-dev/[email protected]
61
+ with :
62
+ pixi-version : v0.28.2
63
+ - name : Cache rust dependencies
64
+ uses : Swatinem/rust-cache@v2
65
+ with :
66
+ cache-on-failure : True
67
+ - name : Run codegen
68
+ run : pixi run vendor
69
+ - name : Check that git detects no file changes
70
+ run : git diff --exit-code
71
+
72
+ # Run linux tests without Pixi due to undiagnosed linker issues
73
+ # - undefined reference to fcntl64
74
+ # - undefined reference to memfd_create
75
+ vl-convert-rs-tests-linux :
64
76
runs-on : ubuntu-latest
65
77
steps :
66
78
- name : Check out repository code
@@ -69,57 +81,62 @@ jobs:
69
81
uses : actions-rs/toolchain@v1
70
82
with :
71
83
toolchain : stable
72
- override : true
73
- components : rustfmt
74
84
- name : Cache rust dependencies
75
85
uses : Swatinem/rust-cache@v2
76
86
with :
87
+ prefix-key : " v1-rust"
77
88
cache-on-failure : True
78
- - name : Install Deno
79
- uses : denoland /setup-deno@v1
89
+ - name : Install Protoc
90
+ uses : arduino /setup-protoc@v2
80
91
with :
81
- deno-version : vx.x.x
82
- - name : Run codegen
83
- run : cargo run
84
- working-directory : vl-convert-vendor
85
- - name : Check that git detects to file changes
86
- run : git diff --exit-code
92
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
93
+ - name : Install fonts on Linux
94
+ if : runner.os == 'Linux'
95
+ run : |
96
+ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
97
+ sudo apt-get install ttf-mscorefonts-installer
98
+ - name : Run rs tests
99
+ # Run tests on single thread for Deno, which expects this
100
+ run : |
101
+ cargo test -p vl-convert-rs -- --test-threads=1
102
+ - name : Run CLI tests
103
+ run : |
104
+ cargo test -p vl-convert -- --test-threads=1
105
+ - name : Upload test failures
106
+ uses : actions/upload-artifact@v4
107
+ if : always()
108
+ with :
109
+ name : failed-images
110
+ path : |
111
+ vl-convert-rs/tests/vl-specs/failed
87
112
88
113
vl-convert-rs-tests :
89
114
runs-on : ${{ matrix.os }}
90
115
strategy :
91
116
matrix :
92
117
os :
93
- - ubuntu-latest
94
118
- windows-2022
95
119
- macos-12
96
120
steps :
97
121
- name : Check out repository code
98
122
uses : actions/checkout@v2
99
- - name : Install latest stable Rust toolchain
100
- uses : actions-rs/toolchain@v1
123
+ -
uses :
prefix-dev/[email protected]
101
124
with :
102
- toolchain : stable
125
+ pixi-version : v0.28.2
103
126
- name : Cache rust dependencies
104
127
uses : Swatinem/rust-cache@v2
105
128
with :
106
129
prefix-key : " v1-rust"
107
130
cache-on-failure : True
108
- - name : Install Protoc
109
- uses : arduino/setup-protoc@v2
110
- with :
111
- repo-token : ${{ secrets.GITHUB_TOKEN }}
112
131
- name : Install fonts on Linux
113
132
if : runner.os == 'Linux'
114
133
run : |
115
134
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
116
135
sudo apt-get install ttf-mscorefonts-installer
117
136
- name : Run tests
118
- # Run tests on single thread for Deno, which expects this
119
- run : |
120
- cargo test --release -- --test-threads=1
137
+ run : pixi run test-rs
121
138
- name : Upload test failures
122
- uses : actions/upload-artifact@v2
139
+ uses : actions/upload-artifact@v4
123
140
if : always()
124
141
with :
125
142
name : failed-images
@@ -140,53 +157,21 @@ jobs:
140
157
steps :
141
158
- name : Check out repository code
142
159
uses : actions/checkout@v2
143
- - name : Install latest stable Rust toolchain
144
- uses : actions-rs/toolchain@v1
160
+ -
uses :
prefix-dev/[email protected]
145
161
with :
146
- toolchain : stable
162
+ pixi-version : v0.28.2
147
163
- name : Cache rust dependencies
148
164
uses : Swatinem/rust-cache@v2
149
165
with :
150
166
prefix-key : " v1-rust"
151
167
cache-on-failure : True
152
- - name : Install Protoc
153
- uses : arduino/setup-protoc@v2
154
- with :
155
- repo-token : ${{ secrets.GITHUB_TOKEN }}
156
168
- name : Install fonts on Linux
157
169
if : runner.os == 'Linux'
158
170
run : |
159
171
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
160
172
sudo apt-get install ttf-mscorefonts-installer
161
- - name : Display rust version
162
- run : |
163
- rustc --version
164
- - uses : actions/setup-python@v5
165
- with :
166
- python-version : ${{ matrix.options[1] }}
167
- cache : ' pip'
168
- - name : Create Python Environment (Not Windows)
169
- if : runner.os != 'Windows'
170
- run : |
171
- python -m venv venv
172
- source venv/bin/activate
173
- pip install pytest maturin scikit-image pypdfium2
174
- maturin develop --release -m vl-convert-python/Cargo.toml
175
- - name : Create Python Environment (Windows)
176
- if : runner.os == 'Windows'
177
- run : |
178
- python -m venv venv
179
- venv\Scripts\activate
180
- pip install pytest maturin scikit-image pypdfium2
181
- maturin develop --release -m vl-convert-python/Cargo.toml
182
- - name : Run tests (Not Windows)
183
- if : runner.os != 'Windows'
184
- run : |
185
- source venv/bin/activate
186
- pytest vl-convert-python/tests/
187
- - name : Run tests (Windows)
188
- if : runner.os == 'Windows'
189
- run : |
190
- venv\Scripts\activate
191
- pytest vl-convert-python/tests/
173
+ - name : Build package
174
+ run : pixi run dev-py
175
+ - name : Run tests
176
+ run : pixi run test-py
192
177
0 commit comments