diff options
author | Hécate <hecate+gitlab@glitchbra.in> | 2020-09-26 17:15:10 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-09 08:44:26 -0400 |
commit | f7e2fff96975128397e2dab7d57da3c9c6b8c76b (patch) | |
tree | c1aaa7d3750531a648787c075b804f242d28e589 /.gitlab-ci.yml | |
parent | e48cab2a57f2342891f985bcb44817e17e985275 (diff) | |
download | haskell-f7e2fff96975128397e2dab7d57da3c9c6b8c76b.tar.gz |
Add linting of `base` to the CI
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 83 |
1 files changed, 62 insertions, 21 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9243f9e41e..df2608a9d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: e1cdfaea745989faa266f09c1d6c4c981aa34dc6 + DOCKER_REV: 6ceb0cecaeefd4927b26c054e4897724986078c8 # Sequential version number capturing the versions of all tools fetched by # .gitlab/ci.sh. @@ -17,13 +17,14 @@ variables: GIT_SUBMODULE_STRATEGY: "recursive" stages: - - lint # Source linting - - quick-build # A very quick smoke-test to weed out broken commits - - build # A quick smoke-test to weed out broken commits - - full-build # Build all the things - - packaging # Source distribution, etc. - - testing # head.hackage correctness and compiler performance testing - - deploy # push documentation + - tool-lint # Source linting of the tools + - quick-build # A very quick smoke-test to weed out broken commits + - lint # Source linting of GHC + - build # A quick smoke-test to weed out broken commits + - full-build # Build all the things + - packaging # Source distribution, etc. + - testing # head.hackage correctness and compiler performance testing + - deploy # push documentation # Note [The CI Story] # ~~~~~~~~~~~~~~~~~~~ @@ -81,11 +82,11 @@ workflow: ############################################################ -# Linting +# tool linting ############################################################ ghc-linters: - stage: lint + stage: tool-lint image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" script: - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME @@ -105,7 +106,7 @@ ghc-linters: # Run mypy Python typechecker on linter scripts. lint-linters: - stage: lint + stage: tool-lint image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" script: - mypy .gitlab/linters/*.py @@ -115,7 +116,7 @@ lint-linters: # Check that .T files all parse by listing broken tests. lint-testsuite: - stage: lint + stage: tool-lint image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" script: - make -Ctestsuite list_broken TEST_HC=$GHC @@ -125,7 +126,7 @@ lint-testsuite: # Run mypy Python typechecker on testsuite driver typecheck-testsuite: - stage: lint + stage: tool-lint image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" script: - mypy testsuite/driver/runtests.py @@ -137,7 +138,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - stage: lint + stage: tool-lint image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" script: - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME @@ -169,7 +170,7 @@ lint-submods-branch: - if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/' .lint-changelogs: - stage: lint + stage: tool-lint image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" dependencies: [] tags: @@ -189,7 +190,6 @@ lint-release-changelogs: rules: - if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/' - ############################################################ # Validation via Pipelines (hadrian) ############################################################ @@ -235,10 +235,12 @@ lint-release-changelogs: validate-x86_64-linux-deb9-hadrian: extends: .validate-linux-hadrian + needs: [hadrian-ghc-in-ghci] stage: build validate-x86_64-linux-deb9-unreg-hadrian: extends: .validate-linux-hadrian + needs: [validate-x86_64-linux-deb9-hadrian] stage: full-build variables: CONFIGURE_ARGS: --enable-unregisterised @@ -246,6 +248,7 @@ validate-x86_64-linux-deb9-unreg-hadrian: hadrian-ghc-in-ghci: stage: quick-build + needs: [ghc-linters, lint-linters, lint-submods] image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" before_script: # workaround for docker permissions @@ -274,6 +277,37 @@ hadrian-ghc-in-ghci: - cabal-cache ############################################################ +# GHC source code linting +############################################################ + +.lint-params: + stage: lint + needs: [ghc-linters, lint-submods] + tags: + - lint + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" + before_script: + - export PATH="/opt/toolchain/bin:$PATH" + # workaround for docker permissions + - sudo chown ghc:ghc -R . + - git submodule sync --recursive + - git submodule update --init --recursive + - git checkout .gitmodules + - .gitlab/ci.sh setup + - cabal update + - cd hadrian; cabal new-build -j`../mk/detect-cpu-count.sh` --with-compiler=$GHC --project-file=ci.project; cd .. + variables: + GHC_FLAGS: -Werror + +lint-base: + extends: .lint-params + script: + - hadrian/build -c -j stage1:lib:base + - hadrian/build -j lint:base + cache: + key: lint + +############################################################ # Validation via Pipelines (make) ############################################################ @@ -301,7 +335,9 @@ hadrian-ghc-in-ghci: ################################# .build-x86_64-freebsd: + stage: full-build extends: .validate + needs: [validate-x86_64-linux-deb9-hadrian] tags: - x86_64-freebsd allow_failure: true @@ -331,23 +367,19 @@ hadrian-ghc-in-ghci: # Conditional due to lack of builder capacity validate-x86_64-freebsd: extends: .build-x86_64-freebsd - stage: full-build rules: - if: '$CI_MERGE_REQUEST_LABELS =~ /.*FreeBSD.*/' nightly-x86_64-freebsd: <<: *nightly extends: .build-x86_64-freebsd - stage: full-build release-x86_64-freebsd: <<: *release extends: .build-x86_64-freebsd - stage: full-build .build-x86_64-freebsd-hadrian: extends: .validate-hadrian - stage: full-build tags: - x86_64-freebsd allow_failure: true @@ -374,7 +406,6 @@ release-x86_64-freebsd: # Disabled due to lack of builder capacity .validate-x86_64-freebsd-hadrian: extends: .build-x86_64-freebsd-hadrian - stage: full-build ################################# # x86_64-darwin @@ -382,6 +413,7 @@ release-x86_64-freebsd: validate-x86_64-darwin: extends: .validate + needs: [validate-x86_64-linux-deb9-hadrian] stage: full-build tags: - x86_64-darwin @@ -411,6 +443,7 @@ validate-x86_64-darwin: # Disabled because of OS X CI capacity .validate-x86_64-darwin-hadrian: stage: full-build + needs: [validate-x86_64-linux-deb9-hadrian] tags: - x86_64-darwin variables: @@ -440,6 +473,7 @@ validate-x86_64-darwin: .validate-linux: extends: .validate + needs: [validate-x86_64-linux-deb9-hadrian] tags: - x86_64-linux variables: @@ -809,6 +843,7 @@ validate-x86_64-linux-fedora27: .build-windows: # For the reasons given in #17777 this build isn't reliable. + needs: [validate-x86_64-linux-deb9-hadrian] allow_failure: true before_script: - git clean -xdf @@ -929,6 +964,7 @@ release-x86_64-windows-integer-simple: doc-tarball: stage: packaging + needs: [validate-x86_64-linux-deb9-debug, validate-x86_64-windows-hadrian, validate-x86_64-linux-deb9-unreg-hadrian] tags: - x86_64-linux image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" @@ -964,6 +1000,7 @@ doc-tarball: source-tarball: stage: packaging + needs: [validate-x86_64-linux-deb9-unreg-hadrian] tags: - x86_64-linux image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" @@ -998,6 +1035,7 @@ source-tarball: .hackage: stage: testing + needs: [doc-tarball] image: ghcci/x86_64-linux-deb9:0.2 tags: - x86_64-linux @@ -1026,6 +1064,7 @@ nightly-hackage: perf-nofib: stage: testing + needs: [validate-x86_64-linux-deb9-dwarf, doc-tarball] dependencies: - validate-x86_64-linux-deb9-dwarf image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" @@ -1062,6 +1101,7 @@ perf-nofib: perf: stage: testing + needs: [validate-x86_64-linux-deb9-dwarf, doc-tarball] dependencies: - validate-x86_64-linux-deb9-dwarf image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" @@ -1097,6 +1137,7 @@ perf: pages: stage: deploy + needs: [doc-tarball] dependencies: - doc-tarball image: ghcci/x86_64-linux-deb9:0.2 |