summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorCheng Shao <terrorjack@type.dance>2023-01-09 12:45:32 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2023-01-13 11:47:17 +0000
commit93b9bbc177ca848bc80dc23aea3571c42d640192 (patch)
treeff98a94cee20cffa898b98ffec4bed117654c02b /.gitlab-ci.yml
parentd31fcbca6cf4bc166904cfd25696503401ad631d (diff)
downloadhaskell-93b9bbc177ca848bc80dc23aea3571c42d640192.tar.gz
ci: improve nix-shell for gen_ci.hs and fix some ghc/hlint warnings
- Add a ghc environment including prebuilt dependencies to the nix-shell. Get rid of the ad hoc cabal cache and all dependencies are now downloaded from the nixos binary cache. - Make gen_ci.hs a cabal package with HLS integration, to make future hacking of gen_ci.hs easier. - Fix some ghc/hlint warnings after I got HLS to work. - For the lint-ci-config job, do a shallow clone to save a few minutes of unnecessary git checkout time.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml22
1 files changed, 8 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 235ef2dc0f..ace87aaf3b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -262,26 +262,20 @@ lint-author:
- *drafts-can-fail-lint
lint-ci-config:
- image: "nixos/nix:2.8.0"
+ image: nixos/nix:2.12.0
extends: .lint
+ # We don't need history/submodules in this job
variables:
- BUILD_FLAVOUR: default
+ GIT_DEPTH: 1
+ GIT_SUBMODULE_STRATEGY: none
before_script:
- - mkdir -p ~/.cabal
- - cp -Rf cabal-cache/* ~/.cabal || true
+ - echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
+ - nix-channel --update
script:
- - nix shell --extra-experimental-features nix-command --extra-experimental-features flakes nixpkgs#cabal-install nixpkgs#ghc -c cabal update
- .gitlab/generate_jobs
- # 1 if .gitlab/generate_jobs changed the output of the generated config
- - nix shell --extra-experimental-features nix-command --extra-experimental-features flakes nixpkgs#git -c git diff --exit-code
- after_script:
- - rm -Rf cabal-cache
- - cp -Rf ~/.cabal cabal-cache
+ # 1 if .gitlab/generate_jobs changed the output of the generated config
+ - nix shell nixpkgs#git -c git diff --exit-code
dependencies: []
- cache:
- key: lint-ci-$CACHE_REV
- paths:
- - cabal-cache
lint-submods:
extends: .lint-submods