File: .gitlab-ci.yml

package info (click to toggle)
rust-sequoia-keyring-linter 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 536 kB
  • sloc: makefile: 4
file content (153 lines) | stat: -rw-r--r-- 4,086 bytes parent folder | download
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
# Only ever create pipelines for tags or branches.
# Avoid creation of detached pipelines for merge requests.
workflow:
  rules:
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH

stages:
  - lint
  - test
  - deploy

# These stanzas do some common management tasks before and after the
# job-specific before_script and after_script stanzas are run.
# before_script_start configures any default global state.  The
# job-specific before_script can override this state, if required.
# before_script_end prints out information about the environment to
# improve debugging; it does not modify the environment.
# after_script_end does some common management tasks after the
# job-specific after_script is run.  It prints information about the
# environment, and does some clean up.
#
# Add this to your stanza as follows:
#
#   before_script:
#     - *before_script_start
#     - *** YOUR CODE HERE ***
#     - *before_script_end
#   after_script:
#     - *** YOUR CODE HERE ***
#     - *after_script_end

.before_script_start: &before_script_start
  - 'if test "x${RUSTFLAGS+SET}" = xSET; then echo "\$RUSTFLAGS is set ($RUSTFLAGS)"; exit 1; fi'

.before_script_end: &before_script_end
  - 'if test "x${RUSTFLAGS+SET}" = xSET; then echo "WARNING: before_script set \$RUSTFLAGS ($RUSTFLAGS)"; fi'
  - rustc --version --verbose
  - cargo --version
  - clang -v
  - if [ -d $CARGO_TARGET_DIR ]; then find $CARGO_TARGET_DIR | wc --lines; du -sh $CARGO_TARGET_DIR; fi
  - if [ -d $CARGO_HOME ]; then find $CARGO_HOME | wc --lines; du -sh $CARGO_HOME; fi

.after_script_end: &after_script_end
  - if [ -d $CARGO_TARGET_DIR ]; then du -sh $CARGO_TARGET_DIR; fi
  - if [ -d $CARGO_HOME ]; then du -sh $CARGO_HOME; fi

before_script:
  - *before_script_start
  - *before_script_end

after_script:
  - *after_script_end

cache: &general_cache_config
  # default key is default
  # default policy is pull-push
  paths:
    - $CARGO_TARGET_DIR
    - $CARGO_HOME

.rust-stable:
  image: registry.gitlab.com/sequoia-pgp/build-docker-image/rust-stable:latest
  before_script:
    - *before_script_start
    - *before_script_end
  after_script:
    - *after_script_end
  cache:
    # inherit all general cache settings
    <<: *general_cache_config
    # override the key
    key: "rust-stable"

.bookworm:
  image: registry.gitlab.com/sequoia-pgp/build-docker-image/bookworm:latest
  before_script:
    - *before_script_start
    - *before_script_end
  after_script:
    - *after_script_end
  cache:
    # inherit all general cache settings
    <<: *general_cache_config
    # override the key
    key: "bookworm"

codespell:
  stage: lint
  extends: .bookworm

  before_script:
    - *before_script_start
    - codespell --version
    - *before_script_end
  script:
    - codespell --config .codespellrc --summary
  after_script: []

test-bookworm:
  stage: test
  extends: .bookworm
  script:
    - cargo test --all

test-rust-stable:
  stage: test
  extends: .rust-stable
  script:
    - cargo test --all

rust-stable-armv7:
  stage: test
  image: registry.gitlab.com/sequoia-pgp/build-docker-image/bullseye-cross-arm-prebuild:latest
  before_script:
    - *before_script_start
    - cat .ci/snippet_for_cross_compilation_config.toml >> .cargo/config.toml
    - *before_script_end
  script:
    - cargo test --all
  variables:
    CARGO_PACKAGES: -p buffered-reader -p sequoia-openpgp
    CARGO_FLAGS: --target=armv7-unknown-linux-gnueabihf
    PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig
    PKG_CONFIG_ALLOW_CROSS: 1

deny:
  stage: lint
  extends: .rust-stable
  script:
    - cargo deny check
  rules:
    - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
      when: manual
      allow_failure: true
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
      allow_failure: false
  cache: []

all_commits:
  # Test each commit up to main, to facilitate bisecting.
  stage: test
  extends: .bookworm
  script:
    - .ci/all_commits.sh
  variables:
    GIT_STRATEGY: clone

variables:
  CARGO_HOME: cargo/
  CARGO_FLAGS: --color always
  CARGO_INCREMENTAL: 0
  CARGO_TARGET_DIR: target/