Skip to content

Commit

Permalink
Merge branch 'master' into lars/validate-mining-arch
Browse files Browse the repository at this point in the history
  • Loading branch information
larskuhtz authored Oct 3, 2024
2 parents 6af6cc1 + 3fa69e8 commit b3bfbf8
Show file tree
Hide file tree
Showing 30 changed files with 647 additions and 825 deletions.
51 changes: 38 additions & 13 deletions .github/workflows/applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,36 @@ jobs:
if "${{ github.event_name == 'schedule' }}" == "true"; then
MATRIX="$(jq -c '.' <<EOF
{
"ghc": ["9.6.5", "9.8.1"],
"cabal": ["3.10"],
"ghc": ["9.6.6", "9.8.2", "9.10.1"],
"cabal": ["3.12"],
"os": ["ubuntu-20.04", "ubuntu-22.04"],
"use-freeze-file": ["false"]
"use-freeze-file": ["false"],
"include" : [
{
"ghc": "9.8.2",
"cabal": "3.12",
"os": "ubuntu-22.04",
"use-freeze-file": "true"
}
]
}
EOF
)"
else
MATRIX="$(jq -c '.' <<EOF
{
"ghc": ["9.6.5"],
"cabal": ["3.10"],
"os": ["ubuntu-20.04", "ubuntu-22.04"],
"use-freeze-file": ["true"]
"ghc": ["9.6.6", "9.8.2", "9.10.1"],
"cabal": ["3.12"],
"os": ["ubuntu-22.04"],
"use-freeze-file": ["false"],
"include" : [
{
"ghc": "9.8.2",
"cabal": "3.12",
"os": "ubuntu-22.04",
"use-freeze-file": "true"
}
]
}
EOF
)"
Expand Down Expand Up @@ -235,12 +250,16 @@ jobs:
if: startsWith(matrix.os, 'ubuntu-')
run: sudo chown -R $USER /usr/local/.ghcup
- 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
- name: Install non-Haskell dependencies (ubuntu)
Expand Down Expand Up @@ -326,11 +345,12 @@ jobs:
diff -w <(git show HEAD:cabal.project.freeze) cabal.project.freeze || true
- name: Sync from cabal cache
if: env.USE_CABAL_CACHE == 'true'
uses: larskuhtz/cabal-cache-action@a0f263d898dd246217960262caa1d381cf066e9a
uses: larskuhtz/cabal-cache-action@4b537195b33898fcd9adc62cee2a44986fd7b1b6
with:
bucket: "kadena-cabal-cache"
region: "us-east-1"
folder: "${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.use-freeze-file }}"
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
Expand Down Expand Up @@ -486,6 +506,7 @@ jobs:
databaseDirectory: "db"
chainweb:
onlySyncPact: true
logGas: true
chainwebVersion: ${{ needs.config.outputs.chainweb-network-version }}
validateHashesOnReplay: true
p2p:
Expand Down Expand Up @@ -627,14 +648,17 @@ jobs:
# when adding more than one build, use a different package name or
# different tags
include:
- ghc: "9.6.5"
os: "ubuntu-20.04"
- ghc: "9.8.2"
os: "ubuntu-22.04"
use-freeze-file: "true"
- ghc: "9.10.1"
os: "ubuntu-22.04"
use-freeze-file: "false"
env:
OS: ${{ matrix.os }}
ARTIFACTS_NAME: chainweb-applications.${{ matrix.use-freeze-file }}.${{ matrix.ghc }}.${{ matrix.os }}
ARTIFACTS_ARCHIVE: chainweb.${{ matrix.use-freeze-file }}.${{ matrix.ghc }}.${{ matrix.os }}.${{ needs.config.outputs.git-sha-short }}${{ needs.config.outputs.tag-suffix }}.tar.gz

steps:
- name: Get build artifacts
uses: actions/download-artifact@v4
Expand All @@ -646,6 +670,7 @@ jobs:
run: |
tar -xzf "$ARTIFACTS_ARCHIVE"
# ubuntu-22.04 only include libssl3. ubuntu-20.04 uses libssl1.1
- name: Create Dockerfile
run: |
cat > Dockerfile <<DEOF
Expand All @@ -663,7 +688,7 @@ jobs:
apt-get install -y \
ca-certificates \
libgmp10 \
libssl1.1 \
libssl3 \
libsnappy1v5 \
zlib1g \
liblz4-1 \
Expand Down
47 changes: 29 additions & 18 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ on:

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.6.5"]
cabal: ["3.10"]
os: ["macos-14-large"]
ghc: ["9.8.2"]
cabal: ["3.12"]
os: ["macos-latest"]
cabalcache: ["true"]

steps:
Expand All @@ -28,7 +29,7 @@ jobs:
name: Restore ghc & cabal binaries cache
id: ghc-cabal-cache
env:
key: ${{ runner.os }}-ghc-cabal
key: ${{ runner.os }}-${{ runner.arch }}-ghc-cabal
with:
path: |
/Users/runner/.ghcup
Expand All @@ -38,22 +39,30 @@ jobs:
- 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: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.*', '*.cabal', 'src/**', 'test/**') }}
key: ${{ env.key }}-${{ hashFiles('cabal.*', '*.cabal', 'src/**', 'test/**', 'bench/**', 'tools/**') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-
${{ 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
Expand All @@ -80,15 +89,6 @@ jobs:
package pact
documentation: False
EOF
- 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 }}
# Build
- name: Delete Freeze file if it exists
Expand All @@ -103,11 +103,12 @@ jobs:
cabal freeze
- name: Sync from cabal cache
if: matrix.cabalcache == 'true'
uses: larskuhtz/cabal-cache-action@018b7ae0c480ba3dc4fa0cfa3a0bc1f05b7724b3
uses: larskuhtz/cabal-cache-action@4b537195b33898fcd9adc62cee2a44986fd7b1b6
with:
bucket: "kadena-cabal-cache"
region: "us-east-1"
folder: "${{ matrix.os }}"
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
Expand All @@ -117,10 +118,20 @@ jobs:
- 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
cabal run tests -- --hide-successes -p '!/chainweb216Test/'
# Checks
- name: Check that working directory tree is clean
Expand Down
Loading

0 comments on commit b3bfbf8

Please sign in to comment.