From 500fcaf753222defae56f8f8d6943460bb5f275b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Wed, 5 Feb 2025 13:38:08 +0800 Subject: [PATCH] ci: Use new docker-supporting backend workflows --- .config/nextest.toml | 7 +++ .config/startci.sh | 7 +++ .github/workflows/rust-workflow.yml | 92 +---------------------------- 3 files changed, 16 insertions(+), 90 deletions(-) create mode 100755 .config/startci.sh diff --git a/.config/nextest.toml b/.config/nextest.toml index 6da7054..9c1f30b 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -11,6 +11,9 @@ e2e = { max-threads = 1 } [script.start-e2e-env] command = "./.config/starte2e.sh" +[script.start-ci-env] +command = "./.config/startci.sh" + [[profile.default.scripts]] filter = "test(e2e)" setup = "start-e2e-env" @@ -26,3 +29,7 @@ fail-fast = false path = "junit.xml" store-success-output = true store-failure-output = true + +[[profile.ci.scripts]] +filter = "test(e2e)" +setup = "start-ci-env" diff --git a/.config/startci.sh b/.config/startci.sh new file mode 100755 index 0000000..800970a --- /dev/null +++ b/.config/startci.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -eu + +sed 's|./|/home/runner/work/famedly-sync/famedly-sync|g' -i tests/environment/docker-compose.yaml +# shellcheck source=./starte2e.sh +./starte2e.sh diff --git a/.github/workflows/rust-workflow.yml b/.github/workflows/rust-workflow.yml index 4594c28..261175a 100644 --- a/.github/workflows/rust-workflow.yml +++ b/.github/workflows/rust-workflow.yml @@ -8,9 +8,6 @@ on: pull_request: branches: [ "*" ] -env: - CARGO_TERM_COLOR: always - # Make sure there is no pipeline running uselessly. concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -18,91 +15,6 @@ concurrency: # Defined CI jobs. jobs: - simple-checks: - container: docker-oss.nexus.famedly.de/rust-container:nightly - runs-on: ubuntu-latest - steps: - - name: Checkout current repository - uses: actions/checkout@v4 - - - uses: famedly/backend-build-workflows/.github/actions/rust-prepare@main - with: - gitlab_ssh: ${{ secrets.CI_SSH_PRIVATE_KEY}} - gitlab_user: ${{ secrets.GITLAB_USER }} - gitlab_pass: ${{ secrets.GITLAB_PASS }} - - - name: Caching - uses: Swatinem/rust-cache@68b3cb7503c78e67dae8373749990a220eb65352 - with: - cache-on-failure: true - cache-all-crates: true - - - name: Rustfmt - shell: bash - run: cargo +${NIGHTLY_VERSION} fmt -- --check - - - name: Clippy - shell: bash - run: cargo +${NIGHTLY_VERSION} clippy --workspace --all-targets -- -D warnings - - - name: Doc-test - shell: bash - run: cargo +${NIGHTLY_VERSION} test --doc --workspace --verbose - - - name: Udeps - shell: bash - run: cargo +${NIGHTLY_VERSION} udeps - - - name: Typos - shell: bash - run: typos --exclude '*.key' --exclude '*.crt' --exclude '*.csr' --exclude '*.srl' - tests: - runs-on: ubuntu-latest - steps: - - name: Checkout current repository - uses: actions/checkout@v4 - - - uses: famedly/backend-build-workflows/.github/actions/rust-prepare@main - with: - gitlab_ssh: ${{ secrets.CI_SSH_PRIVATE_KEY}} - gitlab_user: ${{ secrets.GITLAB_USER }} - gitlab_pass: ${{ secrets.GITLAB_PASS }} - - - name: Add llvm-tools rust component - run: rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu - - - name: Caching - uses: Swatinem/rust-cache@68b3cb7503c78e67dae8373749990a220eb65352 - with: - cache-on-failure: true - cache-all-crates: true - - - name: Install additional cargo tooling - shell: bash - run: cargo install cargo-nextest cargo-llvm-cov --locked - - - name: Test - timeout-minutes: 20 - shell: bash - run: | - docker compose --project-directory ./tests/environment down -v - cargo llvm-cov nextest --profile ci --workspace --lcov --output-path lcov.info - - - name: Get docker logs on failure - shell: bash - if: failure() - run: | - docker compose --project-directory ./tests/environment logs - - - name: Codecov - Upload coverage - uses: codecov/codecov-action@v4 - with: - token: ${{secrets.CODECOV_TOKEN}} - files: lcov.info - - - name: Codecov - Upload test results - uses: codecov/test-results-action@v1 - with: - token: ${{secrets.CODECOV_TOKEN}} - + uses: famedly/backend-build-workflows/.github/workflows/rust-workflow.yml@c09c1ba4fb90a3311af4cc0fb985ddfd79cd884c + secrets: inherit