Skip to content

Commit 3ed3c2b

Browse files
ci: Use new docker-supporting backend workflows
Kick CI again?
1 parent faf18a0 commit 3ed3c2b

File tree

4 files changed

+18
-90
lines changed

4 files changed

+18
-90
lines changed

.config/nextest.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ experimental = ["setup-scripts"]
88
# already exist) - we don't want this.
99
e2e = { max-threads = 1 }
1010

11+
[script.sed-mounts-ci]
12+
command = "./.config/sedmounts.sh"
13+
1114
[script.start-e2e-env]
1215
command = "./.config/starte2e.sh"
1316

@@ -26,3 +29,7 @@ fail-fast = false
2629
path = "junit.xml"
2730
store-success-output = true
2831
store-failure-output = true
32+
33+
[[profile.ci.scripts]]
34+
filter = "test(e2e)"
35+
setup = "sed-mounts-ci"

.config/sedmounts.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
# Change the volume mounts to point to the correct host paths in CI
6+
# runners
7+
sed 's|source: \./|source: /home/runner/work/famedly-sync/famedly-sync/|g' -i tests/environment/docker-compose.yaml

.config/starte2e.sh

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

21+
cat ./tests/environment/docker-compose.yaml
22+
2123
# Shut down any still running test-setup first
2224
docker compose --project-directory ./tests/environment down -v test-setup $ldap_down || true
2325
docker compose --project-directory ./tests/environment 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

0 commit comments

Comments
 (0)