-
Notifications
You must be signed in to change notification settings - Fork 15
154 lines (132 loc) · 4.09 KB
/
test.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
name: Test the package
on:
push:
branches:
- main
pull_request:
paths:
- 'bin/**'
- 'fitsio/**'
- 'fitsio-derive/**'
- 'fitsio-sys/**'
- 'testdata/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'Cross.toml'
- 'rust-toolchain.toml'
- '.github/workflows/*.yml'
# Only one pull-request triggered run should be executed at a time
# (head_ref is only set for PR events, otherwise fallback to run_id which differs for every run).
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
ci-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- rust: stable
- rust: beta
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install ubuntu dependencies
run: |
sudo apt-get update && sudo apt-get install --no-install-recommends -y \
llvm-dev \
libcfitsio-dev \
pkg-config \
libssl-dev \
python3
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.rust}}
override: true
components: rustfmt, clippy
- name: cargo generate-lockfile
# enable this ci template to run regardless of whether the lockfile is checked in or not
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Test the code
run: python3 ./bin/test --rust-version ${{matrix.rust}} --test all
macos-test:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- rust: stable
- rust: beta
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install cfitsio python3
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{matrix.rust}}
override: true
components: rustfmt, clippy
- name: cargo generate-lockfile
# enable this ci template to run regardless of whether the lockfile is checked in or not
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Test the code
run: python3 ./bin/test --rust-version ${{matrix.rust}} --test all
linux-armv7:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: armv7-unknown-linux-gnueabihf
# workaround https://github.com/cross-rs/cross/issues/1177
- name: Install cargo cross
run: |
cargo install cross --locked
- name: cargo generate-lockfile
# enable this ci template to run regardless of whether the lockfile is checked in or not
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Test the code
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --target armv7-unknown-linux-gnueabihf --manifest-path fitsio/Cargo.toml
windows-test:
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up msys2
uses: msys2/setup-msys2@v2
- name: Install dependencies
shell: msys2 {0}
run: |
pacman -S --noconfirm \
mingw64/mingw-w64-x86_64-cfitsio \
mingw64/mingw-w64-x86_64-pkg-config \
mingw64/mingw-w64-x86_64-rust
- name: cargo generate-lockfile
# enable this ci template to run regardless of whether the lockfile is checked in or not
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Run the tests
shell: msys2 {0}
run: |
cargo test -p fitsio