-
Notifications
You must be signed in to change notification settings - Fork 14
129 lines (118 loc) · 4.14 KB
/
build.yaml
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
name: build
on:
push:
paths:
- "**"
- "!docs/**"
- "!examples/**"
- "!images/**"
- "!**.md"
- "!**.ipynb"
- "resources/**"
# manual trigger
workflow_dispatch: {}
env:
RUST_LOG: "debug"
RUST_LOG_SPAN_EVENTS: "new,close"
RUST_BACKTRACE: "1"
jobs:
lint_fmt:
name: Lint / Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
- name: license headers
run: |
cargo test -p kamu-repo-tools -- license_header
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- -D warnings
lint_deps:
name: Lint / Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall cargo-deny -y
- run: cargo deny check
- run: cargo binstall cargo-udeps -y
- run: cargo udeps --all-targets
test:
strategy:
fail-fast: false
matrix:
include:
- name: Linux / amd64
runs-on: ubuntu-latest
cargo-flags: --profile ci --features ftp
nextest-flags: --cargo-profile ci --features ftp
container-runtime: podman
ipfs: true
# TODO: Not running docker as it takes ~7 minutes to install
# See: https://github.com/actions/runner/issues/1456
- name: MacOS / amd64
runs-on: macos-13
cargo-flags: --profile ci --features ftp
nextest-flags: --cargo-profile ci --features ftp -E '!test(::containerized::)'
container-runtime: ''
ipfs: false
# TODO: M1 cannot run docker due to lack of nested virtualization
# See: https://github.com/marketplace/actions/setup-docker-on-macos#arm64-processors-m1-m2-m3-series-used-on-macos-14-images-are-unsupported
- name: MacOS / arm64
runs-on: macos-14
cargo-flags: --profile ci
nextest-flags: --cargo-profile ci -E '!test(::containerized::)'
container-runtime: ''
ipfs: false
# TODO: DataFusion tests are temporarily disabled
# See: https://github.com/kamu-data/kamu-cli/issues/226
- name: Windows / amd64
runs-on: windows-latest
cargo-flags: --profile ci
nextest-flags: --cargo-profile ci -E 'not (test(::containerized::) | test(::datafusion::))'
container-runtime: ''
ipfs: false
name: Test / ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup IPFS
uses: ibnesayeed/setup-ipfs@master
if: matrix.ipfs
with:
ipfs_version: "0.19"
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install cargo tools
# TODO: Restore --locked switch as soon as `cargo-nextest` releases version with `ahash>=0.8.7`
run: |
cargo install cargo-nextest
- name: Configure runtime
if: matrix.container-runtime != ''
run: |
echo '{ "kind": "CLIConfig", "version": 1, "content": {"engine": { "runtime": "${{ matrix.container-runtime }}" } } }' > ~/.kamuconfig
echo "KAMU_CONTAINER_RUNTIME_TYPE=${{ matrix.container-runtime }}" >> $GITHUB_ENV
- name: Build
run: cargo test ${{ matrix.cargo-flags }} --no-run
- name: Pull test images
if: matrix.container-runtime != ''
run: cargo nextest run ${{ matrix.nextest-flags }} -E 'test(::setup::)' --no-capture
- name: Run tests
run: cargo nextest run ${{ matrix.nextest-flags }}
# Not running on windows due to line ending differences
- name: Check generated files
if: "!contains(matrix.runs-on, 'windows')"
run: git diff && git diff-index --quiet HEAD