-
Notifications
You must be signed in to change notification settings - Fork 12
119 lines (102 loc) · 2.93 KB
/
main.yml
File metadata and controls
119 lines (102 loc) · 2.93 KB
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
name: CI
on:
push:
branches:
- main
- feat/*
pull_request: {}
release:
types:
- created
jobs:
test:
name: Test on ${{ matrix.os }} with features ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
# Limit test threads to 1 to show test name before execution.
RUST_TEST_THREADS: 1
steps:
- name: Set git autocrlf to input
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
# if: matrix.os != 'windows-latest'
# - name: Install stable toolchain (windows)
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# target: x86_64-pc-windows-gnu
# override: true
# if: matrix.os == 'windows-latest'
- name: Install `just` command runner
uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup (debian)
run: |
echo "Install system tools"
sudo apt-get update -y
sudo apt-get install -y curl xz-utils build-essential gcc-multilib valgrind
if: matrix.os == 'ubuntu-latest'
# - name: Setup (windows)
# run: |
# $env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;$env:PATH"
# echo "PATH=${env:PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "CARGO_BUILD_TARGET=x86_64-pc-windows-gnu" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# if: matrix.os == 'windows-latest'
- name: Build (default features)
env:
FEATURES: ""
run: |
cargo clean
just FEATURES="$FEATURES" build
- name: Test (default features)
env:
FEATURES: ""
run: |
just FEATURES="$FEATURES" test
# - name: Build (--no-default-features)
# env:
# FEATURES: "--no-default-features"
# run: |
# cargo clean
# just FEATURES="$FEATURES" build
# - name: Test (--no-default-features)
# env:
# FEATURES: "--no-default-features"
# run: |
# just FEATURES="$FEATURES" test
- name: Build (--all-features)
env:
FEATURES: "--all-features"
run: |
cargo clean
just FEATURES="$FEATURES" build
- name: Test (--all-features)
env:
FEATURES: "--all-features"
run: |
just FEATURES="$FEATURES" test
- name: Lint
run: just lint
if: matrix.os == 'ubuntu-latest'
# - name: Check for leaks (Valgrind)
# run: just valgrind
# if: matrix.os == 'ubuntu-latest'