-
Notifications
You must be signed in to change notification settings - Fork 24
220 lines (192 loc) · 6.45 KB
/
pr-check.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: PR/CI Check
on:
pull_request:
push:
branches-ignore:
- main
- release*
- release/*
- release-*
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
run_cli: "yes"
- os: windows-latest
target: aarch64-pc-windows-msvc
run_cli: "no"
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
run_cli: "yes"
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-latest
# target: arm-unknown-linux-gnueabihf
- os: macos-latest
target: x86_64-apple-darwin
run_cli: "yes"
- os: macos-14
target: aarch64-apple-darwin
run_cli: "yes"
# - os: ubuntu-latest
# target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Python to PATH
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Homebrew Python
if: startsWith( matrix.os, 'macos')
run: brew install python
shell: bash
- name: Add Conda to PATH
if: startsWith( matrix.os, 'windows')
run: |
$path = $env:PATH + ";" + $env:CONDA + "\condabin"
echo "PATH=$path" >> $env:GITHUB_ENV
- name: Add Conda to PATH
if: startsWith( matrix.os, 'ubuntu')
run: echo "PATH=$PATH:$CONDA/condabin" >> $GITHUB_ENV
shell: bash
- name: Install Conda + add to PATH
if: startsWith( matrix.os, 'macos')
run: |
curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash ~/miniconda.sh -b -p ~/miniconda
echo "PATH=$PATH:$HOME/miniconda/bin" >> $GITHUB_ENV
echo "CONDA=$HOME/miniconda" >> $GITHUB_ENV
shell: bash
- name: Check Conda version
run: conda info --all
- name: Create Conda Environments
run: |
conda create -n test-env1 python=3.12 -y
conda create -n test-env-no-python -y
conda create -p ./prefix-envs/.conda1 python=3.12 -y
conda create -p ./prefix-envs/.conda-nopy -y
- name: Install pipenv
run: pip install pipenv
- name: Check pipenv version
run: pipenv --version
- name: Install virtualenvwrapper
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
pip install virtualenvwrapper
echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv venv_wrapper_env1
shell: bash
- name: Install virtualenvwrapper-win
if: startsWith( matrix.os, 'windows')
run: |
pip install virtualenvwrapper-win
echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV
shell: bash
- name: Install pyenv
if: startsWith( matrix.os, 'windows')
run: |
choco install pyenv-win -y
echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV
echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
shell: bash
- name: Install pyenv and pyenv-virtualenv
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
curl https://pyenv.run | bash
echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV
shell: bash
- name: Check Pyenv version
run: pyenv --version
shell: bash
- name: Install Pyenv Python(s)
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
pyenv install --list
pyenv install 3.12.3 3.8.19
shell: bash
# pyenv-win install list has not updated for a while
- name: Install Pyenv Python(s)
if: startsWith( matrix.os, 'windows')
run: |
pyenv install --list
pyenv install 3.10.5 3.8.10
shell: bash
- name: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Cargo Fetch
run: cargo fetch
shell: bash
- name: Run Tests
run: cargo test --frozen --all-features -- --nocapture
shell: bash
- name: Find Environments
if: matrix.run_cli == 'yes'
run: cargo run --release --target ${{ matrix.target }}
shell: bash
builds:
name: Builds
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
run_cli: "yes"
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-latest
# target: arm-unknown-linux-gnueabihf
- os: macos-latest
target: x86_64-apple-darwin
run_cli: "yes"
- os: macos-14
target: aarch64-apple-darwin
run_cli: "yes"
# - os: ubuntu-latest
# target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Cargo Fetch
run: cargo fetch
shell: bash
- name: Run Tests
# We do not want to run all features, CI is only for tests with Python
# Thats a separate job.
run: cargo test --frozen
shell: bash
- name: Build
run: cargo build --release --target ${{ matrix.target }}
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: pet-${{ matrix.target }}
path: target/${{ matrix.target }}/release/pet*