Skip to content

classify diffs update #5901

classify diffs update

classify diffs update #5901

Workflow file for this run

name: Build with MacOS
on:
workflow_dispatch:
push:
# paths-ignore:
# - '.github/**'
jobs:
# Note that cabal-cache-action only support arm64 for macos
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ["9.8.2"]
cabal: ["3.12"]
os: ["macos-latest"]
cabalcache: ["true"]
steps:
# Setup
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache/restore@v4
name: Restore ghc & cabal binaries cache
id: ghc-cabal-cache
env:
key: ${{ runner.os }}-${{ runner.arch }}-ghc-cabal
with:
path: |
/Users/runner/.ghcup
key: ${{ env.key }}-${{ hashFiles('bin/cabal', 'bin/ghc') }}
restore-keys: ${{ env.key }}-
- uses: actions/cache/restore@v4
name: Restore dist-newstyle cache
id: cabal-dist-cache
env:
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.ghc }}-dist
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ env.key }}-${{ hashFiles('cabal.*', '*.cabal', 'src/**', 'test/**', 'bench/**', 'tools/**') }}
restore-keys: |
${{ env.key }}
- name: Install GHC and Cabal
id: setup
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Confirm GHC and Cabal installation
run: |
echo "setup ghc-version: ${{ steps.setup.outputs.ghc-version }}"
echo "setup cabal-version: ${{ steps.setup.outputs.cabal-version }}"
echo "setup cabal-store: ${{ steps.setup.outputs.cabal-store }}"
ghc --version
cabal --version
ghc --version
cabal --version
- uses: actions/cache/save@v4
name: Cache ghc & cabal binaries
if: steps.ghc-cabal-cache.outputs.cache-hit != 'true'
with:
path: |
/Users/runner/.ghcup
key: ${{ steps.ghc-cabal-cache.outputs.cache-primary-key }}
- name: Install non-Haskell dependencies (macOS)
run: |
brew update && brew install gflags llvm snappy || true
- name: Create cabal.project.local
run: |
cat > cabal.project.local <<EOF
package *
documentation: False
package chainweb
documentation: False
benchmarks: True
tests: True
package pact
documentation: False
EOF
# Build
- name: Delete Freeze file if it exists
run: rm -f cabal.project.freeze
- name: Update package database
run: cabal update
- name: Display outdated packages
run: cabal outdated
- name: Configure build
run: |
cabal build all --dry-run
cabal freeze
- name: Sync from cabal cache
if: matrix.cabalcache == 'true'
uses: larskuhtz/cabal-cache-action@4b537195b33898fcd9adc62cee2a44986fd7b1b6
with:
bucket: "kadena-cabal-cache"
region: "us-east-1"
folder: "packages/${{ matrix.os }}"
store_path: ${{ steps.setup.outputs.cabal-store }}
aws_access_key_id: "${{ secrets.kadena_cabal_cache_aws_access_key_id }}"
aws_secret_access_key: "${{ secrets.kadena_cabal_cache_aws_secret_access_key }}"
- name: Install build dependencies
run: cabal build chainweb --only-dependencies
- name: Build chainweb library
run: cabal build lib:chainweb
- name: Build chainweb applications
run: cabal build exe:chainweb-node test:chainweb-tests exe:cwtool chainweb:bench:bench
- uses: actions/cache/save@v4
name: Save dist-newstyle cache
if: steps.cabal-dist-cache.outputs.cache-hit != 'true'
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ steps.cabal-dist-cache.outputs.cache-primary-key }}
- name: Run Tests
run: |
ulimit -n 10000
cabal run tests -- --hide-successes -p '!/chainweb216Test/'
# Checks
- name: Check that working directory tree is clean
run: |
mv cabal.project.freeze cabal.project.freeze.backup
git checkout -- cabal.project.freeze || true
if ! git diff --exit-code; then
echo "Git working tree is not clean. The build changed some file that is checked into git." 1>&2
exit 1
fi
mv cabal.project.freeze.backup cabal.project.freeze
- name: Run ea and verify consistency of genesis headers
run: |
cabal run cwtool -- ea
mv cabal.project.freeze cabal.project.freeze.backup
git checkout -- cabal.project.freeze || true
if ! git diff --exit-code; then
echo "Inconsistent genesis headers detected. Did you forget to run ea?" 1>&2
exit 1
fi
mv cabal.project.freeze.backup cabal.project.freeze