-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
111 lines (102 loc) · 2.94 KB
/
.gitlab-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
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
variables:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
# For builds in shell executors, try to not leave traces outside our work folder
RUSTUP_HOME: .rustup
CARGO_HOME: .cargo
.common_build:
script:
- rustup default stable
- rustup target install $TARGET
- cargo build --target=$TARGET --workspace --all-features --verbose
- cargo clippy --target=$TARGET --all-features -- -D warnings -A clippy::nonminimal-bool -A clippy::type_complexity -A clippy::too-many-arguments
- cargo fmt -- --check
- mkdir -p test-binaries-$TARGET-$OSVER/workers/
- cargo build --target=$TARGET --tests
- cargo build --target=$TARGET --tests --message-format=json | python tests/copy_artifacts.py test-binaries-$TARGET-$OSVER/
- cargo install cargo-license --target=$TARGET
- cargo license --filter-platform=$TARGET --all-features --tsv
artifacts:
expire_in: 1h
name: test-binaries
paths:
- test-binaries-$TARGET-$OSVER/
.debian_build:
extends: .common_build
tags:
- linux
- docker
variables:
TARGET: $ARCH-unknown-linux-gnu
before_script:
- dpkg --add-architecture i386
- apt update
- apt install -y libseccomp-dev libseccomp2 libcap2 libcap-dev python3 python-is-python3 gcc-multilib
- apt install -y libseccomp-dev:i386 libseccomp2:i386 libcap-dev:i386 libcap2:i386
parallel:
matrix:
- ARCH: [i686, x86_64]
build_debian11:
extends: .debian_build
image: rust:bullseye
variables:
OSVER: debian11
build_debian12:
extends: .debian_build
image: rust:bookworm
variables:
OSVER: debian12
build_windows:
extends: .common_build
tags:
- windows
- selfhosted
- builder
variables:
RUSTFLAGS: -D warnings -Ctarget-feature=+crt-static
TARGET: $ARCH-pc-windows-msvc
OSVER: win10
before_script:
- if (!(Get-Command python)) { choco install -y --no-progress python3 }
- Invoke-WebRequest -Uri https://win.rustup.rs/$ARCH -OutFile rustup-init.exe
- .\rustup-init.exe -y --default-toolchain stable-$TARGET
- $env:Path=[System.Environment]::GetEnvironmentVariable("Path","Machine")+";"+[System.Environment]::GetEnvironmentVariable("Path","User")
parallel:
matrix:
- ARCH: [i686, x86_64]
test_win10_1507_x86_64:
tags:
- win10_1507
- x64
needs:
- job: build_windows
artifacts: true
script:
- tests/run.ps1 test-binaries-x86_64-pc-windows-msvc-win10/
test_debian11_i686:
tags:
- debian11
- i686
needs:
- job: build_debian11
artifacts: true
script:
- tests/run.sh test-binaries-i686-unknown-linux-gnu-debian11/
test_debian11_x64:
tags:
- debian11
- x64
needs:
- job: build_debian11
artifacts: true
script:
- tests/run.sh test-binaries-x86_64-unknown-linux-gnu-debian11/
test_debian12_x64:
tags:
- debian12
- x64
needs:
- job: build_debian12
artifacts: true
script:
- tests/run.sh test-binaries-x86_64-unknown-linux-gnu-debian12/