Skip to content

Commit

Permalink
Move Stack and Nix builds to GitLab CI
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnbastiaan committed Mar 12, 2021
1 parent 083fc18 commit 31e92bb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .ci/stack_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
63 changes: 0 additions & 63 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -168,8 +117,6 @@ workflows:
# - ghc-8.6
- ghc-8.8
- ghc-8.10
- stack-build
- nix-build

jobs:
ghc-8.4:
Expand Down Expand Up @@ -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
30 changes: 30 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31e92bb

Please sign in to comment.