abstract gas #1922
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build" | |
on: | |
pull_request: | |
push: | |
branches: | |
main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
nix-build: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
include: | |
- os: ubuntu-latest | |
os_attr: x86_64-linux | |
- os: macos-latest | |
os_attr: x86_64-macos | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: build hevm | |
run: nix build .#ci -L | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hevm-${{ matrix.os_attr }} | |
path: result/bin/hevm | |
extra-tests: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
include: | |
- os: ubuntu-latest | |
- os: macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
# can't be run in nix build due to network usage | |
- name: run rpc tests | |
run: nix-shell --pure --command "cabal run rpc-tests" | |
# if we run this in nix build we often get killed due to oom in ci | |
- name: run ethereum tests | |
run: nix-shell --pure --command "cabal run ethereum-tests" | |
build-windows: | |
name: build (windows-latest) | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
path-type: inherit | |
update: true | |
install: >- | |
base-devel | |
gmp-devel | |
openssl-devel | |
git | |
unzip | |
pacboy: >- | |
cmake:p | |
ninja:p | |
gcc:p | |
autotools:p | |
gmp:p | |
openssl:p | |
- uses: haskell/actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: '9.2.8' | |
- name: build and install c dependencies | |
run: | | |
echo "::group::Installing libsecp256k1" | |
./.github/scripts/install-libsecp256k1.sh | |
echo "::endgroup::" | |
echo "::group::Installing libff" | |
./.github/scripts/install-libff.sh | |
echo "::endgroup::" | |
- name: Configure the build | |
run: | | |
cabal configure --disable-tests --disable-benchmarks --disable-documentation | |
cabal build --dry-run | |
# The last step generates dist-newstyle/cache/plan.json for the cache key. | |
- name: Restore cached dependencies | |
uses: actions/cache/restore@v3 | |
id: cache | |
env: | |
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.key }}- | |
- name: Install haskell dependencies | |
run: cabal build all --only-dependencies | |
# Cache dependencies already, so that we do not have to rebuild them should the subsequent steps fail. | |
- name: Save cached dependencies | |
uses: actions/cache/save@v3 | |
# Caches are immutable, trying to save with the same key would error. | |
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: build hevm library | |
run: | | |
cabal build --extra-include-dirs="$HOME/.local/include" --extra-lib-dirs="$HOME/.local/lib" | |
cabal-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: run cabal check | |
run: nix develop -c cabal check --verbose=3 |