-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
82 lines (76 loc) · 3.04 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
test_native_job:
# Run all native tests
image:
name: $CI_REGISTRY/lucidac/firmware/hybrid-controller/platformio-build
script:
- apt update
- apt install git build-essential -y
- pio test -e native --filter native/* --filter emulated/*
test_others_job:
# Compile all non-native test cases to check for incompatible changes in the codebase
# This helps with noticing that a change breaks an old test case
# This takes a fairly long time and may be disabled if it becomes too annoying
allow_failure: true
image:
name: $CI_REGISTRY/lucidac/firmware/hybrid-controller/platformio-build
script:
- pio test -e testing --without-uploading --without-testing --filter hardware/* --filter manual/* --ignore manual/teensy_basics/*
build_job:
image:
name: $CI_REGISTRY/lucidac/firmware/hybrid-controller/platformio-build
script:
- platformio run -e teensy41
- echo ANABRID_BUILD_JOB_ID=$CI_JOB_ID > .anabrid_build_result.env
artifacts:
paths:
- .pio/build/teensy41/firmware.hex
# Save job id in artifacts for release job
reports:
dotenv: .anabrid_build_result.env
expire_in: 4 weeks
build_docs:
variables:
# clone submodules which are currently only relevant for docs
GIT_SUBMODULE_STRATEGY: normal
image: alpine # suggested in https://gitlab.com/pages/doxygen but shitty
script:
- apk update && apk add doxygen py3-pip make # TODO: this is slow, use proper image
- pip install --break-system-packages -r docs/sphinx/requirements.txt # TODO: Again, this shall be cached
- make docs
artifacts:
paths:
- docs/doxygen/html
- docs/sphinx/_build
upload_docs:
needs: build_docs
# TODO: Change to a specialized image
image: svenk/latex
needs: # instead of "dependencies:", should go faster
- job: build_docs
artifacts: true
script:
- chmod 600 "$SSH_PRIVATE_KEY_FILE_STAGING"
- echo "ai.svenk.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE2YTwpWWq4ceRXHbCFHlw5kmRVLQjKbdYeFAAyYUDXFRhCjRknE6DKlGIIciKOqzAMiFGz5/vxb6tKMCKBeFU0=" > ~/userknown.txt
- echo "cd anabrid.dev/docs/lucidac-firmware/doxygen" >> sftp.txt
- echo "put -R docs/doxygen/html/*" >> sftp.txt
- echo "cd ../sphinx" >> sftp.txt
- echo "put -R docs/sphinx/_build/*" >> sftp.txt
- cat sftp.txt | sftp -o "UserKnownHostsFile=~/userknown.txt" -i"$SSH_PRIVATE_KEY_FILE_STAGING" $DEPLOY_STAGING_SSH_HOST
release_job:
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
needs:
- job: build_job
artifacts: true
script:
- echo "Releasing binary built in build_job ${ANABRID_BUILD_JOB_ID}."
release:
name: 'LUCIDAC Firmware v$CI_COMMIT_TAG'
description: 'LUCIDAC firmware release version $CI_COMMIT_TAG.'
# tag_name is a mendatory field and can not be an empty string
tag_name: '$CI_COMMIT_TAG'
assets:
links:
- name: 'Firmware binary hex file'
url: '$CI_PROJECT_URL/-/jobs/${ANABRID_BUILD_JOB_ID}/artifacts/raw/.pio/build/teensy41/firmware.hex'