forked from GitoxideLabs/gitoxide
-
Notifications
You must be signed in to change notification settings - Fork 1
153 lines (143 loc) · 4.51 KB
/
Copy pathci.yml
File metadata and controls
153 lines (143 loc) · 4.51 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
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
name: ci
on:
push:
branches: [ main ]
tags-ignore: [ '*' ]
paths:
- '.github/**'
- 'ci/**'
- 'etc/**'
- 'src/**'
- 'tests/**'
- 'cargo-*/**'
- 'git*/**'
- 'experiments/**'
- '*.toml'
- Makefile
pull_request:
branches: [ main ]
paths:
- '.github/**'
- 'ci/**'
- 'etc/**'
- 'src/**'
- 'tests/**'
- 'cargo-*/**'
- 'git*/**'
- 'experiments/**'
- '*.toml'
- Makefile
jobs:
pure-rust-build:
runs-on: ubuntu-latest
container: debian:buster
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Prerequisites
run: apt-get update && apt-get install --no-install-recommends -y ca-certificates curl gcc libc-dev # gcc is required as OS abstraction
- name: install Rust via Rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal;
- run: /github/home/.cargo/bin/cargo build --no-default-features --features max-pure
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Setup dependencies
run:
sudo apt-get install tree
- name: test
env:
CI: true
run: make tests
test-fast:
strategy:
matrix:
os:
- windows-2019
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Setup dependencies (macos)
if: startsWith(matrix.os, 'macos')
run:
brew install tree openssl gnu-sed
- name: "cargo check default features"
if: startsWith(matrix.os, 'windows')
run: cargo check --all --bins --examples
- run: git lfs fetch && git lfs checkout
- uses: taiki-e/install-action@v1
with:
tool: nextest
version: 0.9
- name: "Test (nextest)"
run: cargo nextest run --all --no-fail-fast
installation:
strategy:
matrix:
build: [ win-msvc, win-gnu, win32-msvc ]
include:
- build: win-msvc
os: windows-2019
rust: stable
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-2019
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
- build: win32-msvc
os: windows-2019
rust: nightly
target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: "Install prerequisites"
run: vcpkg install zlib:x64-windows-static-md
- name: "Installation from crates.io: gitoxide"
run: cargo +${{ matrix.rust }} install --target ${{ matrix.target }} --target-dir install-artifacts --debug --force gitoxide
- name: "Installation from crates.io: cargo-smart-release"
run: cargo +${{ matrix.rust }} install --target ${{ matrix.target }} --target-dir install-artifacts --debug --force cargo-smart-release
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.65 # clippy is broken for us in 1.66
components: clippy,rustfmt
- name: Run cargo clippy
run: cargo clippy --all --tests
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo diet
run: |
curl -LSfs https://raw.githubusercontent.com/the-lean-crate/cargo-diet/master/ci/install.sh | \
sh -s -- --git the-lean-crate/cargo-diet --target x86_64-unknown-linux-musl --tag v1.2.4
# Let's not fail CI for this, it will fail locally often enough, and a crate a little bigger
# than allows is no problem either if it comes to that.
make check-size || true
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}