-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (76 loc) · 2.67 KB
/
ci.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
# SPDX-License-Identifier: MIT
name: ci
on:
push:
pull_request:
schedule:
- cron: "0 4 * * *"
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Build and run tests (rust ${{ matrix.rust }})
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
run: |
rm -f ~/.cargo/bin/*fmt ~/.cargo/bin/rust-analyzer
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
- name: Build
run: cargo build --release --verbose
- name: Run check
run: cargo check --release --verbose
- name: Run tests
# Tests started failing with rustc 1.81.0-nightly (5affbb171 2024-07-18)
# previously was ok with rustc 1.81.0-nightly (fcc325f1b 2024-07-17)
# Initialized logging with log level DEBUG
# fatal runtime error: thread::set_current should only be called once per thread
if: ${{ matrix.rust != 'nightly' }}
run: cargo test --release --verbose
# Do a tests with and without -j, because the internal modes of operation are quite different
- name: Simulate package processing without -j
if: ${{ matrix.rust == 'nightly' }}
run: |
mkdir /var/tmp/buildroot-1
cp -a tests/cases /var/tmp/buildroot-1
RPM_BUILD_ROOT=/var/tmp/buildroot-1 target/release/add-determinism --brp /var/tmp/buildroot-1/ --handler=-pyc
- name: Simulate package processing with -j
if: ${{ matrix.rust == 'stable' }}
run: |
mkdir /var/tmp/buildroot-2
cp -a tests/cases /var/tmp/buildroot-2
RPM_BUILD_ROOT=/var/tmp/buildroot-2 target/release/add-determinism -j4 --brp /var/tmp/buildroot-2
- name: Simulate package processing with --check
if: ${{ matrix.rust == 'stable' }}
run: |
RPM_BUILD_ROOT=/var/tmp/buildroot-2 target/release/add-determinism -j4 --brp /var/tmp/buildroot-2 --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
run: |
rm -f ~/.cargo/bin/*fmt ~/.cargo/bin/rust-analyzer
curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Install toolchain
run: |
rustup toolchain install nightly
rustup default nightly
- name: Validate clippy
run: cargo clippy -- -D warnings