diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b5b4c75cddd29443c07156dc79eb9d9b2696dd2..b29e828f482f67a0504bfb4b65b057a9521800a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,38 +10,31 @@ stages: - pages # default setup running on default branch and in MRs -.all-default: +.default: before_script: - pacman-key --init - pacman -Sy --needed --noconfirm archlinux-keyring - source .env && pacman -Syu --needed --noconfirm $PACMAN_PACKAGES - just install-rust-dev-tools + interruptible: true rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # default setup with Rust tools running on default branch and in MRs -.all-default-rust: +.default-rust: before_script: - pacman-key --init - pacman -Sy --needed --noconfirm archlinux-keyring - source .env && pacman -Syu --needed --noconfirm $PACMAN_PACKAGES - just install-rust-dev-tools + interruptible: true rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH -# default setup running in MRs -.mr-default: - before_script: - - pacman-key --init - - pacman -Sy --needed --noconfirm archlinux-keyring - - source .env && pacman -Syu --needed --noconfirm $PACMAN_PACKAGES - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - check-commits: - extends: .mr-default + extends: .default script: # fetch the default branch as we need it for comparison - git fetch origin $CI_DEFAULT_BRANCH @@ -49,58 +42,60 @@ check-commits: - git config --local user.name "Foobar McFooface" - git config --local user.email "foobar@mcfooface.com" - just check-commits + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" stage: check spelling: - extends: .all-default + extends: .default script: - just check-spelling stage: check formatting: - extends: .all-default-rust + extends: .default-rust script: - just check-formatting stage: check lint: - extends: .all-default-rust + extends: .default-rust script: - just lint stage: check unused-deps: - extends: .all-default-rust + extends: .default-rust script: - just check-unused-deps stage: check dependencies: - extends: .all-default-rust + extends: .default-rust script: - just check-dependencies stage: check licenses: - extends: .all-default-rust + extends: .default-rust script: - just check-licenses stage: check links: - extends: .all-default-rust + extends: .default-rust script: - just check-links stage: check test: - extends: .all-default-rust + extends: .default-rust script: - just test stage: test integration-test: - extends: .all-default + extends: .default script: - useradd -m testuser - chown -R testuser:testuser . @@ -110,7 +105,7 @@ integration-test: - vm test-readmes: - extends: .all-default + extends: .default script: - useradd -m testuser - chown -R testuser:testuser . @@ -120,7 +115,7 @@ test-readmes: - vm build-image: - extends: .all-default + extends: .default script: - useradd -m testuser - chown -R testuser:testuser . @@ -134,7 +129,7 @@ build-image: - vm build-test-image: - extends: .all-default + extends: .default script: - useradd -m testuser - chown -R testuser:testuser .