-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (69 loc) · 2.1 KB
/
rust.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
name: Rust
on:
pull_request:
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
ubuntu-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Cache APT Packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: build-essential libgtk-3-dev libhdf5-dev librust-atk-dev
version: 1.0
- name: Install dependencies
run: |
rustup component add clippy
- name: Check package & dependencies for errors
run: cargo check
- name: Lint
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
windows-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup vcpkg, checkout old commit for hdf5 1.12.0
run: |
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout 8534df4e72c7c003fdc26f67e014f27a834d7fb2
cd ..
.\vcpkg\bootstrap-vcpkg.bat
- name: Install HDF5 with vcpkg
run: |
.\vcpkg\vcpkg install hdf5:x64-windows
shell: cmd
- name: Set environment variables for HDF5
run: |
$vcpkg_installed_x64_windows = "$env:GITHUB_WORKSPACE\vcpkg\installed\x64-windows"
echo "HDF5_DIR=$vcpkg_installed_x64_windows" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
echo "VCPKG_ROOT=$env:GITHUB_WORKSPACE\vcpkg" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
$path = "$env:PATH;$vcpkg_installed_x64_windows\bin"
echo "PATH=$path" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
shell: pwsh
- uses: Swatinem/rust-cache@v2
- name: Install Rust dependencies
run: |
rustup component add clippy
- name: Check package & dependencies for errors
run: cargo check
- name: Lint
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose