Skip to content

Commit 245585f

Browse files
ci: Use new docker-supporting backend workflows
1 parent 2d1ce1f commit 245585f

File tree

3 files changed

+25
-97
lines changed

3 files changed

+25
-97
lines changed

.config/starte2e.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ then
1818
ldap_down="-v ldap"
1919
fi
2020

21+
# If we're running in CI, we are in a docker container, so containers
22+
# launched by us do not bind-mount into local directories. Instead, we
23+
# copy the test environment to the host, so that we can bind-mount
24+
# from there.
25+
26+
ENV_PATH="$(dirname "$0")/../tests/environment/"
27+
28+
echo "Profile: $NEXTEST_PROFILE"
29+
30+
if [ "$NEXTEST_PROFILE" = "ci" ]; then
31+
cp -r tests/environment /__w/test-env
32+
ENV_PATH="/__w/test-env/"
33+
fi
34+
35+
export ENV_PATH
36+
2137
# Shut down any still running test-setup first
22-
docker compose --project-directory ./tests/environment down -v test-setup $ldap_down || true
23-
docker compose --project-directory ./tests/environment up --wait
38+
docker compose --project-directory "$ENV_PATH" down -v test-setup $ldap_down || true
39+
docker compose --project-directory "$ENV_PATH" up --wait

.github/workflows/rust-workflow.yml

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -8,101 +8,13 @@ on:
88
pull_request:
99
branches: [ "*" ]
1010

11-
env:
12-
CARGO_TERM_COLOR: always
13-
1411
# Make sure there is no pipeline running uselessly.
1512
concurrency:
1613
group: ${{ github.workflow }}-${{ github.ref }}
1714
cancel-in-progress: true
1815

1916
# Defined CI jobs.
2017
jobs:
21-
simple-checks:
22-
container: docker-oss.nexus.famedly.de/rust-container:nightly
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Checkout current repository
26-
uses: actions/checkout@v4
27-
28-
- uses: famedly/backend-build-workflows/.github/actions/rust-prepare@main
29-
with:
30-
gitlab_ssh: ${{ secrets.CI_SSH_PRIVATE_KEY}}
31-
gitlab_user: ${{ secrets.GITLAB_USER }}
32-
gitlab_pass: ${{ secrets.GITLAB_PASS }}
33-
34-
- name: Caching
35-
uses: Swatinem/rust-cache@68b3cb7503c78e67dae8373749990a220eb65352
36-
with:
37-
cache-on-failure: true
38-
cache-all-crates: true
39-
40-
- name: Rustfmt
41-
shell: bash
42-
run: cargo +${NIGHTLY_VERSION} fmt -- --check
43-
44-
- name: Clippy
45-
shell: bash
46-
run: cargo +${NIGHTLY_VERSION} clippy --workspace --all-targets -- -D warnings
47-
48-
- name: Doc-test
49-
shell: bash
50-
run: cargo +${NIGHTLY_VERSION} test --doc --workspace --verbose
51-
52-
- name: Udeps
53-
shell: bash
54-
run: cargo +${NIGHTLY_VERSION} udeps
55-
56-
- name: Typos
57-
shell: bash
58-
run: typos --exclude '*.key' --exclude '*.crt' --exclude '*.csr' --exclude '*.srl'
59-
6018
tests:
61-
runs-on: ubuntu-latest
62-
steps:
63-
- name: Checkout current repository
64-
uses: actions/checkout@v4
65-
66-
- uses: famedly/backend-build-workflows/.github/actions/rust-prepare@main
67-
with:
68-
gitlab_ssh: ${{ secrets.CI_SSH_PRIVATE_KEY}}
69-
gitlab_user: ${{ secrets.GITLAB_USER }}
70-
gitlab_pass: ${{ secrets.GITLAB_PASS }}
71-
72-
- name: Add llvm-tools rust component
73-
run: rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu
74-
75-
- name: Caching
76-
uses: Swatinem/rust-cache@68b3cb7503c78e67dae8373749990a220eb65352
77-
with:
78-
cache-on-failure: true
79-
cache-all-crates: true
80-
81-
- name: Install additional cargo tooling
82-
shell: bash
83-
run: cargo install cargo-nextest cargo-llvm-cov --locked
84-
85-
- name: Test
86-
timeout-minutes: 20
87-
shell: bash
88-
run: |
89-
docker compose --project-directory ./tests/environment down -v
90-
cargo llvm-cov nextest --profile ci --workspace --lcov --output-path lcov.info
91-
92-
- name: Get docker logs on failure
93-
shell: bash
94-
if: failure()
95-
run: |
96-
docker compose --project-directory ./tests/environment logs
97-
98-
- name: Codecov - Upload coverage
99-
uses: codecov/codecov-action@v4
100-
with:
101-
token: ${{secrets.CODECOV_TOKEN}}
102-
files: lcov.info
103-
104-
- name: Codecov - Upload test results
105-
uses: codecov/test-results-action@v1
106-
with:
107-
token: ${{secrets.CODECOV_TOKEN}}
108-
19+
uses: famedly/backend-build-workflows/.github/workflows/rust-workflow.yml@8fa286305f20cc2aaa1898b931f7188d3e19eeb6
20+
secrets: inherit

tests/environment/docker-compose.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
image: alpine/openssl:3.3.2
44
volumes:
55
- type: bind
6-
source: ./certs
6+
source: ${ENV_PATH}/certs
77
target: /certs
88
entrypoint: /certs/generate-certs.sh
99

@@ -20,7 +20,7 @@ services:
2020
- LDAP_TLS_VERIFY_CLIENTS=try
2121
volumes:
2222
- type: bind
23-
source: ./certs
23+
source: ${ENV_PATH}/certs
2424
target: /certs
2525
read_only: true
2626
depends_on:
@@ -34,10 +34,10 @@ services:
3434
entrypoint: /environment/test-setup.sh
3535
volumes:
3636
- type: bind
37-
source: ./
37+
source: ${ENV_PATH}/
3838
target: /environment
3939
- type: bind
40-
source: ./config.template.yaml
40+
source: ${ENV_PATH}/config.template.yaml
4141
target: /config.template.yaml
4242
read_only: true
4343
healthcheck:
@@ -59,7 +59,7 @@ services:
5959
- 8080:8080
6060
volumes:
6161
- type: bind
62-
source: ./zitadel/
62+
source: ${ENV_PATH}/zitadel/
6363
target: /zitadel-config/
6464
depends_on:
6565
db:

0 commit comments

Comments
 (0)