summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: b05bb9c7aa5d98807d87660105910a68da54d70b (plain)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
stages:
  - pre-check
  - build
  - test


include:
  - component: gitlab.com/sequoia-pgp/common-ci/precheck@main
  - component: gitlab.com/sequoia-pgp/common-ci/authenticate-commits@main
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: trixie
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: trixie-crypto-rust
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
      cargo_args: '--manifest-path openpgp/Cargo.toml --no-default-features --features crypto-rust,compression,allow-experimental-crypto,allow-variable-time-crypto --example supported-algorithms'
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: trixie-crypto-openssl
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
      cargo_args: '--manifest-path openpgp/Cargo.toml --no-default-features --features crypto-openssl,compression --example supported-algorithms'
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: trixie-crypto-botan
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
      cargo_args: '--manifest-path openpgp/Cargo.toml --no-default-features --features crypto-botan2,compression --example supported-algorithms'
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: trixie-crypto-fuzzing
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
      run_test_job: "false"
      cargo_cmd: 'check'
      cargo_args: '--manifest-path openpgp/Cargo.toml --no-default-features --features crypto-fuzzing,compression,allow-experimental-crypto,allow-variable-time-crypto'
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: rust-stable
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/rust-stable-prebuild
      run_test_job: "false"
      cargo_args: '--manifest-path openpgp/Cargo.toml --no-default-features --features crypto-nettle,compression --example supported-algorithms'
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: rust-stable-armv7
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/bullseye-cross-arm-prebuild
      run_test_job: "false"
      cargo_cmd: 'test'
      cargo_args: '--tests --target=armv7-unknown-linux-gnueabihf -p buffered-reader -p sequoia-openpgp'
  - component: gitlab.com/sequoia-pgp/common-ci/rust-basic@main
    inputs:
      job_name: doc
      image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild
      run_test_job: "false"
      cargo_cmd: 'doc'
      cargo_args: '--document-private-items --no-deps'
    
trixie-build:
  script:
    - cargo run --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-nettle,compression --example supported-algorithms
    - if ! git diff --quiet Cargo.lock ; then echo "Cargo.lock changed.  Please add the change to the corresponding commit." ; git diff ; false ; fi
    - if ! git diff --quiet ; then echo "The build changed the source.  Please investigate." ; git diff ; fi

trixie-crypto-rust-build:
  script:
    - cargo test --release --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-rust,compression,allow-experimental-crypto,allow-variable-time-crypto

trixie-crypto-openssl-build:
  script:
    - cargo test --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-openssl,compression

trixie-crypto-botan-build:
  script:
    - cargo test --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-botan2,compression

rust-stable-build:
  script:
    - CARGO_PACKAGES="-p buffered-reader -p sequoia-openpgp" $MAKE_TOP test

rust-stable-armv7-build:
  before_script:
    - !reference [.before_script, start]
    - cat .ci/snippet_for_cross_compilation_config.toml >> .cargo/config.toml
    - !reference [.before_script, end]
  variables:
    PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig
    PKG_CONFIG_ALLOW_CROSS: 1
    
all_commits:
  # Test each commit up to main, to facilitate bisecting.
  stage: test
  interruptible: true
  image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/trixie-prebuild:latest
  needs: ["rust-stable-build"]
  script:
    - .ci/all_commits.sh
  rules:
    - !reference [.default_rules, rules]
  variables:
    GIT_STRATEGY: clone
 
clippy:
  tags:
    - linux
  stage: build
  interruptible: true
  image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/rust-stable-prebuild:latest
  before_script:
    - !reference [.before_script, start]
    - rustup default 1.67.0 # Pin clippy.
    - rustup component add clippy
    - cargo clippy --version
    - !reference [.before_script, end]
  script:
    - cargo clippy
  rules:
    - !reference [.default_rules, rules]

windows-msvc-cng:
  tags:
    - win
    - win2019
  stage: build
  interruptible: true
  image: 192.168.122.1:5000/sequoia-pgp/build-docker-image/windows-msvc
  rules:
    # Forks of this project most likely use gitlab's shared windows runners, which
    # do not use the docker executor, so disable the windows jobs for forks.
    - if: $CI_PROJECT_NAMESPACE != "sequoia-pgp"
      when: never
    - !reference [.default_rules, rules]
  before_script:
    - 'powershell Get-ChildItem env:'
    - rustc --version --verbose
    - cargo --version
  script:
    # https://github.com/rust-lang/cargo/issues/5015
    - cargo run --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression --example supported-algorithms
    - cargo test --tests --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression
  after_script: [] # scriptlet doesn't work on Powershell
  variables:
    CFLAGS: "" # Silence some C warnings when compiling with MSVC

windows-msvc32-cng:
  tags:
    - win
    - win2019
  stage: build
  interruptible: true
  # Depend on the main configuration.  As the jobs have common error
  # conditions, if one fails it is often not worth trying the other.
  # Therefore, we can short-circuit here.  Also, this pipelines
  # Windows jobs, allowing us to test the other toolchain as well.
  needs:
    - windows-msvc-cng
  image:
    name: 192.168.122.1:5000/sequoia-pgp/build-docker-image/windows-msvc
    # Set up a cross compilation environment for building x86 binaries on amd64, line copied from Dockerfile.windows.msvc
    # see https://renenyffenegger.ch/notes/Windows/dirs/Program-Files-x86/Microsoft-Visual-Studio/version/edition/Common7/Tools/VsDevCmd_bat
    #
    # Alternatively: ["C:\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsamd64_x86.bat", "&&", "type", "README", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
    # see https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160
    entrypoint: ["C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "-arch=x86", "-host_arch=amd64", "&&", "type", "README", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
  rules:
    # Forks of this project most likely use gitlab's shared windows runners, which
    # do not use the docker executor, so disable the windows jobs for forks.
    - if: $CI_PROJECT_NAMESPACE != "sequoia-pgp"
      when: never
    - !reference [.default_rules, rules]
  before_script:
    - 'powershell Get-ChildItem env:'
    - rustup target add i686-pc-windows-msvc
    - rustup show
    - rustc --version --verbose
    - cargo --version
  script:
    # https://github.com/rust-lang/cargo/issues/5015
    - cargo test --tests --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression --target i686-pc-windows-msvc
  after_script: [] # scriptlet doesn't work on Powershell
  variables:
    CFLAGS: "" # Silence some C warnings when compiling with MSVC