From ae324aa416e8fe5bc36f8ddc557a82bf330dfd6d Mon Sep 17 00:00:00 2001 From: John Ky Date: Sat, 9 Feb 2019 21:26:03 +1100 Subject: [PATCH 1/2] CI for ghc-8.6.3 --- .circleci/config.yml | 23 +++++++---------------- .travis.yml | 7 ++----- hw-streams.cabal | 2 +- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e3f796..e5b29fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,11 +77,11 @@ jobs: - image: quay.io/haskell_works/ghc-8.6.3:18.04_2018-12-23 <<: *cabalbuild - ghc-8.4.3: + ghc-8.4.4: environment: - - GHC: "ghc8.4.3" + - GHC: "ghc8.4.4" docker: - - image: quay.io/haskell_works/ghc-8.4.3 + - image: quay.io/haskell_works/ghc-8.4.4 <<: *cabalbuild ghc-8.2.2: @@ -91,16 +91,9 @@ jobs: - image: quay.io/haskell_works/ghc-8.2.2 <<: *cabalbuild - ghc-7.10.3: - environment: - - GHC: "ghc7.10.3" - docker: - - image: quay.io/haskell_works/ghc-7.10.3 - <<: *cabalbuild - checked-builds: docker: - - image: quay.io/haskell_works/ghc-8.4.3 + - image: quay.io/haskell_works/ghc-8.4.4 steps: - checkout @@ -131,7 +124,7 @@ jobs: release: docker: - - image: quay.io/haskell_works/ghc-8.4.3 + - image: quay.io/haskell_works/ghc-8.4.4 steps: - checkout @@ -165,15 +158,13 @@ workflows: multiple-ghcs: jobs: - ghc-8.6.3 - - ghc-8.4.3 + - ghc-8.4.4 - ghc-8.2.2 - - ghc-7.10.3 - checked-builds: requires: - ghc-8.6.3 - - ghc-8.4.3 + - ghc-8.4.4 - ghc-8.2.2 - - ghc-7.10.3 tagged-release: jobs: diff --git a/.travis.yml b/.travis.yml index 33a1be2..6890201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,9 +22,9 @@ before_cache: matrix: include: - - compiler: "ghc-8.6.1" + - compiler: "ghc-8.6.3" # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}} + addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}} - compiler: "ghc-8.4.4" # env: TEST=--disable-tests BENCH=--disable-benchmarks addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}} @@ -34,9 +34,6 @@ matrix: - compiler: "ghc-8.0.2" # env: TEST=--disable-tests BENCH=--disable-benchmarks addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}} - - compiler: "ghc-7.10.3" - # env: TEST=--disable-tests BENCH=--disable-benchmarks - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}} before_install: - HC=${CC} diff --git a/hw-streams.cabal b/hw-streams.cabal index fbf9d4e..712d13a 100644 --- a/hw-streams.cabal +++ b/hw-streams.cabal @@ -13,7 +13,7 @@ maintainer: newhoggy@gmail.com copyright: 2016-2018 John Ky license: BSD3 license-file: LICENSE -tested-with: GHC == 8.6.1, GHC == 8.4.4, GHC == 8.2.2, GHC == 8.0.2, GHC == 7.10.3 +tested-with: GHC == 8.6.3, GHC == 8.4.4, GHC == 8.2.2, GHC == 8.0.2 build-type: Simple extra-source-files: README.md From d89946a842dde01c4955ce16af4e7b0668fd0dd5 Mon Sep 17 00:00:00 2001 From: John Ky Date: Thu, 14 Feb 2019 22:25:42 +1100 Subject: [PATCH 2/2] Use CircleCI Orbs --- .circleci/config.yml | 199 +++++---------------------- .circleci/whitelist-dependencies.txt | 1 + 2 files changed, 32 insertions(+), 168 deletions(-) create mode 100644 .circleci/whitelist-dependencies.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index e5b29fd..3188c10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,176 +1,39 @@ -cabalbuild: &cabalbuild - working_directory: ~/project +version: 2.1 - steps: - - checkout +orbs: + haskell: haskell-works/haskell-build@1.5.3 + github: haskell-works/github-release@1.2.1 + hackage: haskell-works/hackage@1.0.0 - - run: - name: Add GHC tools to PATH - command: | - echo "HOME=$HOME" - echo "BASH_ENV=$BASH_ENV" - echo "PATH=$PATH" - echo 'export PATH="$PATH:/opt/ghc/bin/"' >> $BASH_ENV - - - run: - name: Copying scripts - command: | - mkdir -p ~/.local/bin - cp ./scripts/* ~/.local/bin - - - run: - name: GHC version - command: | - echo "$GHC" > ghc.version - date +%Y-%m > month.version - - - run: - name: Find all sub-projects - command: ./scripts/projects-summary > projects.summary - - ##### Building library - - restore_cache: - keys: - - cabal--{{ checksum "ghc.version" }}--{{ .Environment.CACHE_VERSION }}--{{ checksum "projects.summary" }}--extra - - cabal--{{ checksum "ghc.version" }}--{{ .Environment.CACHE_VERSION }}--{{ checksum "projects.summary" }}-- - - cabal--{{ checksum "ghc.version" }}--{{ .Environment.CACHE_VERSION }}--{{ checksum "month.version"}} - - - run: - name: Building build dependencies - command: | - cabal new-update - cabal new-build --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j${CABAL_THREADS:-4} all - cabal new-build --enable-tests --enable-benchmarks --project-file="cabal.project" --dep -j${CABAL_THREADS:-4} all - - - save_cache: - key: cabal--{{ checksum "ghc.version" }}--{{ .Environment.CACHE_VERSION }}--{{ checksum "projects.summary" }}-- - paths: [~/.cabal/packages, ~/.cabal/store] - - - run: - name: Building project - command: | - cabal new-build --enable-tests --enable-benchmarks --project-file="cabal.project" -j${CABAL_THREADS:-4} all - - - save_cache: - key: cabal--{{ checksum "ghc.version" }}--{{ .Environment.CACHE_VERSION }}--{{ checksum "projects.summary" }}--extra - paths: [~/.cabal/packages, ~/.cabal/store] - - - save_cache: - key: cabal--{{ checksum "ghc.version" }}--{{ .Environment.CACHE_VERSION }}--{{ checksum "month.version"}} - paths: [~/.cabal/packages, ~/.cabal/store] - - - run: - name: Running tests - command: | - if grep '^test-suite' *.cabal > /dev/null; then - cabal new-test --enable-tests --project-file="cabal.project" -j${CABAL_THREADS:-4} all - else - echo Not tests to run - fi - -version: 2.0 -jobs: - ghc-8.6.3: - environment: - - GHC: "ghc8.6.3" - docker: - - image: quay.io/haskell_works/ghc-8.6.3:18.04_2018-12-23 - <<: *cabalbuild - - ghc-8.4.4: - environment: - - GHC: "ghc8.4.4" - docker: - - image: quay.io/haskell_works/ghc-8.4.4 - <<: *cabalbuild - - ghc-8.2.2: - environment: - - GHC: "ghc8.2.2" - docker: - - image: quay.io/haskell_works/ghc-8.2.2 - <<: *cabalbuild - - checked-builds: - docker: - - image: quay.io/haskell_works/ghc-8.4.4 - - steps: - - checkout - - - run: - name: Add GHC tools to PATH - command: | - echo "HOME=$HOME" - echo "BASH_ENV=$BASH_ENV" - echo "PATH=$PATH" - echo 'export PATH="$PATH:/opt/ghc/bin/"' >> $BASH_ENV - - - run: - name: Copying scripts - command: | - mkdir -p ~/.local/bin - cp ./scripts/* ~/.local/bin - - - deploy: - command: | - if [ "$CIRCLE_PROJECT_USERNAME" == "haskell-works" ]; then - if [[ "$CIRCLE_BRANCH" == master ]]; then - when tag autotag - elif [[ "$CIRCLE_TAG" =~ v.* ]]; then - publish - fi - fi - - release: - docker: - - image: quay.io/haskell_works/ghc-8.4.4 - - steps: - - checkout +workflows: + multiple-ghc-build: + jobs: + - haskell/build: + name: GHC 8.2.2 + executor: haskell/ghc-8_2_2 - - run: - name: Add GHC tools to PATH - command: | - echo "HOME=$HOME" - echo "BASH_ENV=$BASH_ENV" - echo "PATH=$PATH" - echo 'export PATH="$PATH:/opt/ghc/bin/"' >> $BASH_ENV + - haskell/build: + name: GHC 8.4.4 + executor: haskell/ghc-8_4_4 - - run: - name: Copying scripts - command: | - mkdir -p ~/.local/bin - cp ./scripts/* ~/.local/bin + - haskell/build: + name: GHC 8.6.3 + executor: haskell/ghc-8_6_3 - - deploy: - command: | - if [ "$CIRCLE_PROJECT_USERNAME" == "haskell-works" ]; then - if [[ "$CIRCLE_BRANCH" == master ]]; then - when tag autotag - elif [[ "$CIRCLE_TAG" =~ v.* ]]; then - publish - fi - fi - -workflows: - version: 2 - multiple-ghcs: - jobs: - - ghc-8.6.3 - - ghc-8.4.4 - - ghc-8.2.2 - - checked-builds: + - github/release-cabal: + name: GitHub Release requires: - - ghc-8.6.3 - - ghc-8.4.4 - - ghc-8.2.2 - - tagged-release: - jobs: - - release: + - GHC 8.2.2 + - GHC 8.4.4 + - GHC 8.6.3 + checkout: true filters: branches: - ignore: /.*/ - tags: - only: /^v.*/ + only: master + + - hackage/upload: + publish: true + requires: + - GitHub Release + username: ${HACKAGE_USER} + password: ${HACKAGE_PASS} diff --git a/.circleci/whitelist-dependencies.txt b/.circleci/whitelist-dependencies.txt new file mode 100644 index 0000000..e2e962e --- /dev/null +++ b/.circleci/whitelist-dependencies.txt @@ -0,0 +1 @@ +vector \ No newline at end of file