updated PO files
[tails.git] / .gitlab-ci.yml
blob8d5ff24c0eecbecdf465a2c3f629f00ce7971605
1 workflow:
2   rules:
3     - if: $CI_MERGE_REQUEST_IID
4     - if: $CI_COMMIT_TAG
5     - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
7 image: debian:bullseye
9 variables:
10     GET_SOURCES_ATTEMPTS: 10
12 before_script:
13   - export DEBIAN_FRONTEND=noninteractive
14   - apt-get update -qq
16 .prepare-lint-po: &prepare-lint-po
17   - apt-get -qy install git i18nspector
18   - git clone https://gitlab.tails.boum.org/tails/jenkins-tools.git /tmp/jenkins-tools
20 build-website:
21   rules:
22     - if: '$CI_COMMIT_BRANCH == "master"'
23     - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
24     - changes:
25         - .gitlab-ci.yml
26   script:
27     - apt-get -qy install ikiwiki po4a libyaml-perl libyaml-libyaml-perl libyaml-syck-perl perlmagick
28     - ./build-website
30 lint-po:
31   image: debian:testing
32   rules:
33     - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
34     - changes:
35         - .gitlab-ci.yml
36         - ./**.po
37   script:
38     - *prepare-lint-po
39     - /tmp/jenkins-tools/slaves/lint_po
41 bandit:
42   script:
43   - apt-get -qy install python3-bandit file
44   - bandit --version
45   - './bin/bandit-tree --configfile .bandit.yml
46                        -ll
47                        --format xml
48                        --output bandit.xml
49                        .'
50   artifacts:
51     when: always
52     reports:
53       junit: bandit.xml
55 check-website-core-pages:
56   script:
57     - apt-get -qy install git
58     - ./bin/check-core-pages
60 check-po-msgfmt:
61   rules:
62     - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
63     - changes:
64         - .gitlab-ci.yml
65         - ./**.po
66   script:
67     - apt-get -qy install python3 gettext
68     - ./bin/check-po-msgfmt
70 check-po-meta-date:
71   rules:
72     - if: '$CI_COMMIT_BRANCH =~ /^master|stable|testing|devel$/'
73     - changes:
74         - .gitlab-ci.yml
75         - ./**.po
76   script:
77     - apt-get -qy install git ruby
78     - ./bin/sanity-check-website
80 check-translatable-live-website-urls:
81   script:
82     - apt-get -qy install python3-polib
83     - ./bin/check-translatable-live-website-urls po/tails.pot
85 test-iuk:
86   rules:
87     - if: '$CI_COMMIT_BRANCH != "master"'
88   script:
89   - './bin/test-utils/test-iuk'
91 test-perl5lib:
92   rules:
93     - if: '$CI_COMMIT_BRANCH != "master"'
94   script:
95   - 'cat config/chroot_local-packageslists/tails-perl5lib.list
96        | grep -E -v "^#"
97        | xargs apt-get -qy install'
98   - 'apt-get -qy install
99        apt-file
100        libdist-zilla-plugin-test-notabs-perl
101        libdist-zilla-plugin-test-perl-critic-perl
102        libdist-zilla-app-command-authordebs-perl
103        libmodule-build-perl
104        sudo'
105   - apt-get update -qq # Take into account APT configuration added by apt-file
106   # Otherwise, apt-get called by "dzil authordebs --install" asks confirmation
107   - echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/yes
108   - cd $CI_PROJECT_DIR/config/chroot_local-includes/usr/src/perl5lib
109   - dzil authordebs --install
110   - dzil test --all
112 shellcheck:
113   image: debian:testing
114   script:
115   - apt-get -qy install python3 shellcheck xmlstarlet file
116   - shellcheck --version
117   - './bin/shellcheck-tree --format=checkstyle
118        | xmlstarlet tr config/ci/shellcheck/checkstyle2junit.xslt
119        > shellcheck.xml'
120   artifacts:
121     when: always
122     reports:
123       junit: shellcheck.xml
125 test-persistent-storage-config-file:
126   script:
127     - apt-get -qy install python3 python3-gi acl
128     - config/chroot_local-includes/usr/lib/python3/dist-packages/tps/configuration/config_file_test.py
130 test-python-doctest:
131   script:
132     - apt-get -qy install python3 python3-sh
133     - config/chroot_local-includes/usr/local/lib/tails-gdm-error-message doctest --verbose
134     - env PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages python3 config/chroot_local-includes/usr/local/bin/tails-documentation --doctest
136 test-tca:
137   rules:
138     - if: '$CI_COMMIT_BRANCH != "master"'
139   script:
140     - 'cat config/chroot_local-packageslists/tor-connection-assistant.list
141        | grep -E -v "^#"
142        | xargs apt-get -qy install'
143     - 'cd config/chroot_local-includes/usr/lib/python3/dist-packages ; find tca -name "*.py" -print0 | xargs -0 -L1 env PYTHONPATH=. python3 -m doctest'
145 test-tca-portal:
146   rules:
147     - if: '$CI_COMMIT_BRANCH != "master"'
148   script:
149     - 'cat config/chroot_local-packageslists/tor-connection-assistant.list
150        | grep -E -v "^#"
151        | xargs apt-get -qy install'
152     - 'PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages env python3 ./config/chroot_local-includes/usr/local/lib/tca-portal --doctest-only --log-level DEBUG'
155 test-tailslib:
156   rules:
157     - if: '$CI_COMMIT_BRANCH != "master"'
158   script:
159     - apt-get -qy install python3 python3-atomicwrites python3-sh python3-gi git
160     - 'cd config/chroot_local-includes/usr/lib/python3/dist-packages ; find tailslib -name "*.py" -print0 | grep --null-data -v -e netnsdrop.py -e gnome.py | xargs -0 -L1 env PYTHONPATH=. python3 -m doctest'
162 test-whisperback:
163   rules:
164     - if: '$CI_COMMIT_BRANCH != "master"'
165   script:
166     - 'cat config/chroot_local-packageslists/whisperback.list | grep -E -v "^#"
167          | xargs apt-get -qy install'
168     - apt-get -qy install python3-pytest
169     - 'PYTHONPATH=config/chroot_local-includes/usr/lib/python3/dist-packages
170          pytest-3 --verbose --junit-xml=report.xml
171          config/chroot_local-includes/usr/lib/python3/dist-packages/whisperBack/test.py'
172   artifacts:
173     when: always
174     reports:
175       junit: report.xml
177 apt-snapshots-expiry:
178   script:
179     - apt-get -qy install curl git
180     - ./bin/apt-snapshots-expiry
181   rules:
182     - if: '$CI_COMMIT_BRANCH =~ /^stable|testing|devel$/'
183     - changes:
184         - .gitlab-ci.yml
185         - config/APT_snapshots.d/*/serial
186         - vagrant/definitions/tails-builder/config/APT_snapshots.d/*/serial
188 .install-https-get-expired-build-deps: &install-https-get-expired-build-deps
189   - apt-get -qy install --no-install-recommends golang-go ca-certificates
191 .build-https-get-expired: &build-https-get-expired
192   - go build -o ./https-get-expired config/chroot_local-includes/usr/src/https-get-expired.go
194 .test-https-get-expired: &test-https-get-expired
195   - echo "Basic check:"
196   - ./https-get-expired -reject-expired https://tails.net/
197   - echo "Let's pretend we are in the past. Then, this certificate is still good."
198   - ./https-get-expired -current-time 2000-01-01 -reject-expired https://tails.net/
199   - echo "Let's pretend we are in the future. Then, this certificate is expired"
200   - "! ./https-get-expired -current-time 2090-01-01 -reject-expired https://tails.net/"
201   - "! ./https-get-expired -reject-expired https://wrong.host.badssl.com/"
202   - "! ./https-get-expired -reject-expired https://self-signed.badssl.com/"
203   - "! ./https-get-expired -reject-expired https://untrusted-root.badssl.com/"
204   - "! ./https-get-expired -reject-expired https://expired.badssl.com/"
205   - echo "Invalid host"
206   - "! ./https-get-expired -reject-expired https://nxdomain.tails.net/"
207   - "./bin/test-utils/https-get-expired-test-all"
209 https-get-expired:
210   rules:
211     - if: '$CI_COMMIT_BRANCH =~ /^stable|testing|devel$/'
212     - changes:
213         - .gitlab-ci.yml
214         - config/chroot_local-includes/usr/src/https-get-expired.go
215         - config/chroot_local-includes/etc/default/htpdate.pools
216   script:
217     - *install-https-get-expired-build-deps
218     - *build-https-get-expired
219     - *test-https-get-expired
221 https-get-expired-sid:
222   # this job gives us results using a future version of Golang compared to the one we actually use
223   image: debian:sid
224   rules:
225     - if: '$CI_COMMIT_BRANCH == "devel"'
226     - changes:
227         - .gitlab-ci.yml
228         - config/chroot_local-includes/usr/src/https-get-expired.go
229         - config/chroot_local-includes/etc/default/htpdate.pools
230   script:
231     - *install-https-get-expired-build-deps
232     - *build-https-get-expired
233     - *test-https-get-expired