Skip to content

Refactor poll and send, and add a new invalid tx test #6033

Refactor poll and send, and add a new invalid tx test

Refactor poll and send, and add a new invalid tx test #6033

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 -j \
chainweb:bench:bench \
exe:b64 \
exe:calculate-release \
exe:compact \
exe:db-checksum \
exe:ea \
exe:genconf \
exe:header-dump \
exe:known-graphs \
exe:pact-diff \
exe:run-nodes \
exe:tx-list \
test:chainweb-tests \
test:compaction-tests \
test:multi-node-network-tests \
test:remote-tests
- name: Build chainweb-node application
run: cabal build -j chainweb-node:exe:chainweb-node
- 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 unit tests
run: |
ulimit -n 10000
$(cabal list-bin chainweb:test:chainweb-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 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