|
8 | 8 | pull_request: |
9 | 9 | branches: [ "*" ] |
10 | 10 |
|
11 | | -env: |
12 | | - CARGO_TERM_COLOR: always |
13 | | - |
14 | 11 | # Make sure there is no pipeline running uselessly. |
15 | 12 | concurrency: |
16 | 13 | group: ${{ github.workflow }}-${{ github.ref }} |
17 | 14 | cancel-in-progress: true |
18 | 15 |
|
19 | 16 | # Defined CI jobs. |
20 | 17 | 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 | | - |
60 | 18 | 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