[commit: ghc] wip/head.hackage: gitlab-ci: Implement head.hackage jobs (9b3d4d7)
git at git.haskell.org
git at git.haskell.org
Fri Mar 1 14:30:03 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/head.hackage
Link : http://ghc.haskell.org/trac/ghc/changeset/9b3d4d753afe3e328c9a6c1fb42bd52109177efa/ghc
>---------------------------------------------------------------
commit 9b3d4d753afe3e328c9a6c1fb42bd52109177efa
Author: Ben Gamari <ben at smart-cactus.org>
Date: Wed Feb 27 23:33:12 2019 -0500
gitlab-ci: Implement head.hackage jobs
>---------------------------------------------------------------
9b3d4d753afe3e328c9a6c1fb42bd52109177efa
.gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 217b297..4648276 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,7 @@ stages:
- build
- full-build
- cleanup # See Note [Cleanup on Windows]
+ - hackage
############################################################
# Runner Tags
@@ -426,6 +427,10 @@ validate-x86_64-windows:
- ghc.tar.xz
- junit.xml
+############################################################
+# Cleanup
+############################################################
+
# Note [Cleaning up after shell executor]
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
@@ -477,3 +482,37 @@ cleanup-darwin:
- rm -Rf $BUILD_DIR/*
- exit 0
+
+############################################################
+# Testing via head.hackage
+############################################################
+
+
+.hackage:
+ stage: hackage
+ script:
+ # Here we need an access token (namely $HEAD_HACKAGE_ACCESS_TOKEN) so we
+ # can query the GitLab API to determine the job ID of the fedora27 job of
+ # the current pipeline. @head.hackage owns this token as well.
+ - |
+ job_id=$( \
+ curl \
+ --header "PRIVATE-TOKEN: $HEAD_HACKAGE_ACCESS_TOKEN" \
+ https://gitlab.haskell.org/api/v4/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID \
+ | jq '. | map(select(.name == "validate-x86_64-linux-deb9-llvm")) | .[0].id')
+ GHC_TARBALL="https://gitlab.haskell.org/ghc/ghc/-/jobs/$job_id/artifacts/raw/ghc.tar.xz"
+ - |
+ curl --request POST --form "token=$CI_JOB_TOKEN" \
+ -F "ref=gitlab-ci-nix" \
+ -F "variables[GHC_TARBALL]=$GHC_TARBALL" \
+ https://gitlab.haskell.org/api/v4/projects/78/trigger/pipeline \
+
+hackage:
+ extends: .hackage
+ when: manual
+
+nightly-hackage:
+ extends: .hackage
+ only:
+ variables:
+ - $NIGHTLY
More information about the ghc-commits
mailing list