Skip to content

Commit

Permalink
add .gitlab-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
alyraffauf committed Jul 9, 2024
1 parent 24bf60a commit 7f88a19
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
image: nixos/nix:latest

variables:
NIX_PATH: "nixpkgs=channel:nixos-unstable"
GIT_STRATEGY: clone
GIT_DEPTH: 1


stages:
- "Update"
- "Checks"

"Update inputs":
stage: "Update"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- when: manual
script:
- git clone https://gitlab.com/alyraffauf/wallpapers.git
- cd wallpapers
- git config --global user.email "${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}"
- git config --global user.name "${GIT_USER_NAME:-$GITLAB_USER_NAME}"
- nix --extra-experimental-features "nix-command flakes" flake update --commit-lock-file
- nix --extra-experimental-features "nix-command flakes" flake check
- git push https://${CI_PROJECT_NAMESPACE}:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git "${CI_DEFAULT_BRANCH}" -o ci.skip || echo "No changes to commit"

"Check formatting":
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
stage: "Checks"
script:
- nix --extra-experimental-features "nix-command flakes" fmt -- -c .

"Check evaluation":
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
stage: "Checks"
script:
- nix --extra-experimental-features "nix-command flakes" flake check

0 comments on commit 7f88a19

Please sign in to comment.