Skip to content

Added ERC20 tests in CI #152

Added ERC20 tests in CI

Added ERC20 tests in CI #152

Workflow file for this run

name: 'Run Tests'
on:
pull_request:
push:
branches:
- 'master-update'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pykwasm-code-quality-checks:
name: 'Code Quality Checks'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v4
- name: 'Install Poetry'
uses: Gr1N/setup-poetry@v9
- name: 'Build pykwasm'
run: poetry -C pykwasm install
- name: 'Run code quality checks'
run: make -C pykwasm check
- name: 'Run pyupgrade'
run: make -C pykwasm pyupgrade
- name: 'Run unit tests'
run: make -C pykwasm cov-unit
- name: 'Run Rust unit-tests'
run: make rust-tests
conformance-tests:
name: 'Conformance Tests'
needs: pykwasm-code-quality-checks
runs-on: [self-hosted, aws, us-east-2, m6a.4xlarge]
timeout-minutes: 30
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Set up Docker'
uses: ./.github/actions/with-docker
with:
container-name: kwasm-ci-conformance-${{ github.sha }}
- name: 'Build pykwasm'
run: docker exec -u user kwasm-ci-conformance-${GITHUB_SHA} poetry -C pykwasm install
- name: 'Build LLVM definition'
run: docker exec -u user kwasm-ci-conformance-${GITHUB_SHA} poetry -C pykwasm run kdist -v build wasm-semantics.llvm
- name: 'Run integration tests'
run: docker exec -u user kwasm-ci-conformance-${GITHUB_SHA} make -C pykwasm cov-integration
- name: 'Run simple tests'
run: docker exec -u user kwasm-ci-conformance-${GITHUB_SHA} make -j2 test-simple
- name: 'Run conformance tests: run'
run: docker exec -u user kwasm-ci-conformance-${GITHUB_SHA} make -j2 test-conformance-supported
- name: 'Run conformance tests: parse'
run: docker exec -u user kwasm-ci-conformance-${GITHUB_SHA} make test-conformance-parse
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 kwasm-ci-conformance-${GITHUB_SHA}
erc20-tests:
name: 'ERC20 Tests'
needs: pykwasm-code-quality-checks
runs-on: [self-hosted, aws, us-east-2, m6a.4xlarge]
timeout-minutes: 30
steps:
- uses: actions/create-github-app-token@v1
id: temp-token
name: Generate temporary GitHub Token
with:
app-id: ${{ vars.CICD_GITHUB_WEBAPP_ID }}
private-key: ${{ secrets.CICD_GITHUB_WEBAPP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: 'Check out code'
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Check out blockchain-k-plugin'
uses: actions/checkout@v3
with:
repository: 'runtimeverification/blockchain-k-plugin'
submodules: 'recursive'
path: 'build/deps/plugin'
- name: 'Check out ulm'
uses: actions/checkout@v3
with:
repository: 'pi-squared-inc/ulm'
ref: 'contract-size-limits'
token: ${{ steps.temp-token.outputs.token }}
path: 'build/deps/ulm'
- name: 'Check out evm-semantics'
uses: actions/checkout@v3
with:
repository: 'pi-squared-inc/evm-semantics'
ref: 'ulm'
path: 'build/deps/evm-semantics'
- name: 'Set up Docker'
uses: ./.github/actions/with-k
with:
container-name: kwasm-ci-erc20-${{ github.sha }}
- name: 'Build pykwasm'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} poetry -C pykwasm install
- name: 'Build ulm-wasm'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make ulm-wasm"
- name: 'Build ulm-contract-compiler'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make ulm-contract-compiler"
- name: 'Build ulm-build'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make ulm-build"
- name: 'Build erc20-bin'
run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "CXX=clang++-16 make erc20-bin"
- name: 'Start test'
run: docker exec -u user -d -i -t kwasm-ci-erc20-${GITHUB_SHA} bash -c "(sleep 3 ; ./scripts/ulm-load-lang ./build/lib/libkwasm.so ; tests/ulm/erc20/erc20_test.sh ; tests/ulm/erc20/erc20_negative_test.sh; killall geth ) & (./scripts/run-dev-ulm &> ulm.log)"
# - name: 'Load kwasm library'
# run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "./scripts/ulm-load-lang ./build/lib/libkwasm.so"
# - name: 'Run ERC20 tests'
# run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "tests/ulm/erc20/erc20_test.sh"
# - name: 'Run ERC20 negative tests'
# run: docker exec -u user kwasm-ci-erc20-${GITHUB_SHA} bash -c "tests/ulm/erc20/erc20_negative_test.sh"
- name: 'Tear down Docker'
if: always()
run: |
docker stop --time=0 kwasm-ci-erc20-${GITHUB_SHA}