From edcf64db6fcba1119932c6c7b13b9d3bf25baea6 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Fri, 11 Aug 2023 12:35:09 +0200 Subject: [PATCH] Update CI - Use `input-output-hk/actions` - Deduplicate `check-cabal-files` - Update GHCs to latest patch versions --- .github/workflows/cabal.project.local | 1 - .github/workflows/checks.yml | 49 +------------------------ .github/workflows/ci.yml | 53 ++++++--------------------- .github/workflows/jq-install-plan | 1 - 4 files changed, 12 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/jq-install-plan diff --git a/.github/workflows/cabal.project.local b/.github/workflows/cabal.project.local index 62d969ec26..55dde50346 100644 --- a/.github/workflows/cabal.project.local +++ b/.github/workflows/cabal.project.local @@ -1,4 +1,3 @@ - package cardano-crypto-praos flags: -external-libsodium-vrf diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index db75150ee7..2478a6677c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Install Haskell - uses: input-output-hk/setup-haskell@v1 + uses: input-output-hk/actions/haskell@latest id: setup-haskell with: cabal-version: "3.10.1.0" @@ -48,50 +48,3 @@ jobs: - name: Cabal check run: ./scripts/ci/check-cabal-files.sh - - # Enabling the assertions results in an error in IO-Sim. - # https://github.com/input-output-hk/io-sim/issues/94 - # Until it is fixed, re-enabling this will only lead to blocked CI. - - # cabal-project-asserts: - - # name: Cabal project asserts - - # runs-on: ubuntu-latest - - # defaults: - # run: - # shell: bash - - # env: - - # # current ref from: 27.02.2022 - # SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a - - # SECP_CACHE_VERSION: "2023-04-27" - - # steps: - - # - uses: actions/checkout@v3 - - # - name: Install Haskell - # uses: input-output-hk/setup-haskell@v1 - # id: setup-haskell - # with: - # cabal-version: "3.10.1.0" - # ghc-version: "9.2.7" - - # - name: Install build environment - # run: | - # sudo apt-get update - # sudo apt-get -y install libsodium-dev - - # - name: Install secp256k1 - # uses: input-output-hk/setup-secp256k1@v1 - # with: - # git-ref: ${{ env.SECP256K1_REF }} - # cache-version: ${{ env.SECP_CACHE_VERSION }} - - # - run: | - # ./scripts/ci/regen-project-asserts.sh - # git --no-pager diff --exit-code diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b9c00ba18..2b39a8e7cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,69 +14,42 @@ on: - main jobs: - check-cabal-files: - runs-on: ubuntu-latest - steps: - - name: Install Haskell - uses: input-output-hk/setup-haskell@v1 - id: setup-haskell - with: - cabal-version: "3.10.1.0" - - - uses: actions/checkout@v3 - - - name: Cabal check - run: ./scripts/ci/check-cabal-files.sh - build-test-bench-haddocks: name: Build and test runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - ghc: ["8.10.7", "9.2.7", "9.6.1"] + ghc: ["8.10.7", "9.2.8", "9.6.2"] cabal: ["3.10.1.0"] os: [ubuntu-latest] env: # Modify this value to "invalidate" the Cabal cache. CABAL_CACHE_VERSION: "2023-08-08" - # Modify this value to "invalidate" the secp cache. - SECP_CACHE_VERSION: "2023-04-27" - # current ref from: 27.02.2022 - SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a steps: - uses: actions/checkout@v3 - name: Install Haskell - uses: input-output-hk/setup-haskell@v1 + uses: input-output-hk/actions/haskell@latest id: setup-haskell with: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} - - uses: actions/checkout@v3 - - - name: Install build environment - run: | - sudo apt-get update - sudo apt-get -y install libsodium-dev + - name: Install Haskell + uses: input-output-hk/actions/base@latest + with: + use-sodium-vrf: false - - name: Configure Cabal to use libsodium + - name: Configure Cabal run: | cp .github/workflows/cabal.project.local . - - name: "LINUX: Install build environment (for secp256k1)" - run: sudo apt-get -y install autoconf automake libtool - - - name: Install secp256k1 - uses: input-output-hk/setup-secp256k1@v1 - with: - git-ref: ${{ env.SECP256K1_REF }} - cache-version: ${{ env.SECP_CACHE_VERSION }} - - name: Update Cabal (Hackage and CHaP) - run: cabal clean; cabal update + run: | + cabal clean + cabal update - name: Generate dist-newstyle/cache/plan.json run: cabal build all --dry-run --minimize-conflict-set @@ -94,7 +67,7 @@ jobs: run: | cabal build all --dry-run cat dist-newstyle/cache/plan.json \ - | jq -L .github/workflows/jq-install-plan \ + | jq .["install-plan"][].id \ | sort \ | uniq > dependencies.txt @@ -204,7 +177,6 @@ jobs: if: | github.event_name == 'push' && github.ref == 'refs/heads/main' - && matrix.os=='ubuntu-latest' && matrix.ghc=='8.10.7' run: | cabal build --dry-run --enable-tests all @@ -215,7 +187,6 @@ jobs: if: | github.event_name == 'push' && github.ref == 'refs/heads/main' - && matrix.os=='ubuntu-latest' && matrix.ghc=='8.10.7' uses: actions/upload-artifact@v3 with: @@ -229,7 +200,6 @@ jobs: if: | github.event_name == 'push' && github.ref == 'refs/heads/main' - && matrix.os=='ubuntu-latest' && matrix.ghc=='8.10.7' run: | cabal build --dry-run --enable-tests all @@ -240,7 +210,6 @@ jobs: if: | github.event_name == 'push' && github.ref == 'refs/heads/main' - && matrix.os=='ubuntu-latest' && matrix.ghc=='8.10.7' uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/jq-install-plan b/.github/workflows/jq-install-plan deleted file mode 100644 index 610415e2fc..0000000000 --- a/.github/workflows/jq-install-plan +++ /dev/null @@ -1 +0,0 @@ -.["install-plan"][].id