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 <sbonazzo@redhat.com>
This commit is contained in:
Sandro Bonazzola 2024-07-15 15:49:57 +02:00
parent 9868c60052
commit e21d2a3501
2 changed files with 20 additions and 55 deletions

View File

@ -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

20
.gitlab-ci.yml Normal file
View File

@ -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