From e21d2a3501c58a48bbec2e5b0b12bc478ee46b25 Mon Sep 17 00:00:00 2001 From: Sandro Bonazzola Date: Mon, 15 Jul 2024 15:49:57 +0200 Subject: [PATCH] Convert GitHub Actions in GitLab Pipelines audit test temporary disabled waiting for https://gitlab.com/CentOS/automotive/src/cvd2img/-/issues/3 to be fixed. Clippy test temporary disabled waiting for https://gitlab.com/CentOS/automotive/src/cvd2img/-/issues/2 to be fixed. Fixes: #1 Signed-off-by: Sandro Bonazzola --- .github/workflows/CI.yml | 55 ---------------------------------------- .gitlab-ci.yml | 20 +++++++++++++++ 2 files changed, 20 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/CI.yml create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index a93344b..0000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,55 +0,0 @@ -on: - push: - branches: [main] - pull_request: - -name: CI - -jobs: - check: - name: Build - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: sudo apt install -y libparted-dev libclang-dev - - uses: actions-rs/cargo@v1 - with: - command: build - - fmt: - name: rustfmt - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Clippy - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - run: sudo apt install -y libparted-dev libclang-dev - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8f3805f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +--- + +stages: + - test + +tests: + stage: test + image: fedora:latest + before_script: + - dnf install -y cargo rustfmt clippy parted-devel clang-devel + script: + - cargo build --release + - cargo fmt --all -- --check + # Audit fails, reported: https://gitlab.com/CentOS/automotive/src/cvd2img/-/issues/3 + # TODO: re-enable once fixed + # - cargo install cargo-audit + # - cargo audit + # Clippy fails, reported: https://gitlab.com/CentOS/automotive/src/cvd2img/-/issues/2 + # TODO: re-enable once fixed + # - cargo clippy -- -D warnings