Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
- Use `input-output-hk/actions`
- Deduplicate `check-cabal-files`
- Update GHCs to latest patch versions
  • Loading branch information
jasagredo committed Aug 11, 2023
1 parent 05e37ae commit edcf64d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 92 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cabal.project.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package cardano-crypto-praos
flags: -external-libsodium-vrf

Expand Down
49 changes: 1 addition & 48 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
53 changes: 11 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand 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:
Expand All @@ -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
Expand 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:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/jq-install-plan

This file was deleted.

0 comments on commit edcf64d

Please sign in to comment.