From 31e92bb112b8360f0c5d1c3d25b4a8edb726a2e7 Mon Sep 17 00:00:00 2001 From: Martijn Bastiaan Date: Fri, 12 Mar 2021 10:02:58 +0100 Subject: [PATCH] Move Stack and Nix builds to GitLab CI --- .ci/stack_build.sh | 2 +- .circleci/config.yml | 63 -------------------------------------------- .gitlab-ci.yml | 30 +++++++++++++++++++++ 3 files changed, 31 insertions(+), 64 deletions(-) diff --git a/.ci/stack_build.sh b/.ci/stack_build.sh index 441b3da334..41d9af4f58 100755 --- a/.ci/stack_build.sh +++ b/.ci/stack_build.sh @@ -5,4 +5,4 @@ apt update apt install wget -y wget -q https://get.haskellstack.org/ -O stack_install.sh sh stack_install.sh -stack build -j${THREADS} --flag clash-prelude:-large-tuples +stack build -j${THREADS} diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c67d02239..d070acdd5a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,30 +63,6 @@ aliases: .ci/build.sh fi - - &nix_setup - run: - name: Setup binaries (such as git) - command: | - # Circle CI needs git/ssh in /usr/bin - nix-env -i git findutils gnugrep gnused coreutils openssh bash-4.4-p23 - - # bin nix pkg multiple may exist - ln -s $(find /nix -type f -name git | grep libexec | head -n1) /usr/bin - ln -s $(find /nix -type f -name ssh | grep openssh | head -n1) /usr/bin - ln -s $(find /nix -type f -name sed | grep gnused | head -n1) /usr/bin - ln -s $(find /nix -type f -name bash | grep bash-4.4-p23 | head -n1) /bin - - - &nix_build - run: - name: Build dependencies and Clash itself with Nix - command: .ci/nix_build.sh - no_output_timeout: 1h - - - &stack_build - run: - name: Build dependencies and Clash itself with Stack - command: .ci/stack_build.sh - - &run_tests run: name: Run tests @@ -131,33 +107,6 @@ aliases: - *build - *cache_save - *run_tests - - &build_with_stack - docker: - - image: docker.pkg.github.com/clash-lang/clash-compiler/clash-ci-$GHC_VERSION:2021-02-08 - # Read-only permissions - auth: - username: clash-lang-builder - password: $DOCKER_PASS - steps: - - checkout - - *merge_pullrequest - - *submodules - - *cache_calc_key - - *cache_restore - - *stack_build - - *cache_save - - &build_with_nix - docker: - - image: nixos/nix - steps: - - *cache_calc_key - - *cache_restore - - *nix_setup - - checkout - - *merge_pullrequest - - *submodules - - *nix_build - - *cache_save workflows: version: 2 @@ -168,8 +117,6 @@ workflows: # - ghc-8.6 - ghc-8.8 - ghc-8.10 - - stack-build - - nix-build jobs: ghc-8.4: @@ -203,13 +150,3 @@ jobs: CABAL_VERSION: 3.0.0.0 MULTIPLE_HIDDEN: no <<: *build_default - stack-build: - environment: - GHC_VERSION: 8.10.3 - CABAL_VERSION: 3.2.0.0 - <<: *env - <<: *build_with_stack - nix-build: - environment: - <<: *env - <<: *build_with_nix diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b810a85aca..fe6045faa9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,6 +59,36 @@ tests-9.0: GHC_VERSION: 9.0.1 CABAL_VERSION: 3.4.0.0-rc4 +stack-build: + extends: .common + needs: [] + stage: test + variables: + GHC_VERSION: 8.10.3 + CABAL_VERSION: 3.2.0.0 + script: + - .ci/stack_build.sh + # Run on shared runners + tags: + +nix-build: + image: nixos/nix + needs: [] + stage: test + before_script: + # Circle CI needs git/ssh in /usr/bin + - nix-env -i git findutils gnugrep gnused coreutils openssh bash-4.4-p23 zstd + + # bin nix pkg multiple may exist + - ln -s $(find /nix -type f -name git | grep libexec | head -n1) /usr/bin + - ln -s $(find /nix -type f -name ssh | grep openssh | head -n1) /usr/bin + - ln -s $(find /nix -type f -name sed | grep gnused | head -n1) /usr/bin + - ln -s $(find /nix -type f -name zstd | grep zstd | head -n1) /usr/bin + - ln -s $(find /nix -type f -name bash | grep bash-4.4-p23 | head -n1) /bin + + script: + - .ci/nix_build.sh + # Tests run on shared runners: haddock: extends: .common