-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into _update-deps/runtimeverification/pyk
- Loading branch information
Showing
1 changed file
with
269 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,269 @@ | ||
name: 'User Run Tests' | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
TestType: | ||
description: 'Run A Specific Test' | ||
required: true | ||
type: choice | ||
options: | ||
- 'Pyk Code Quality Checks' | ||
- 'Pyk Unit Tests' | ||
- 'Pyk profile' | ||
- 'Concrete Executions' | ||
- 'Prove Haskell' | ||
- 'Prove Foundry' | ||
- 'Prove Foundry Booster' | ||
- 'Nix' | ||
- 'DockerHub Image Dry Run' | ||
|
||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
kevm-pyk-code-quality-checks: | ||
if: ${{ github.event.inputs.TestType == 'Pyk Code Quality Checks' }} | ||
name: 'Code Quality Checks' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
- name: 'Install Poetry' | ||
uses: Gr1N/setup-poetry@v8 | ||
- name: 'Run code quality checks' | ||
run: make -C kevm-pyk check | ||
- name: 'Run pyupgrade' | ||
run: make -C kevm-pyk pyupgrade | ||
|
||
kevm-pyk-unit-tests: | ||
if: ${{ github.event.inputs.TestType == 'Pyk Unit Tests' }} | ||
name: 'Unit Tests' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: 'Install Poetry' | ||
uses: Gr1N/setup-poetry@v8 | ||
- name: 'Run unit tests' | ||
run: make -C kevm-pyk cov-unit | ||
|
||
kevm-pyk-profile: | ||
if: ${{ github.event.inputs.TestType == 'Pyk profile' }} | ||
name: 'Profiling' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: 'Install Poetry' | ||
uses: Gr1N/setup-poetry@v8 | ||
- name: 'Run profiling' | ||
run: | | ||
make -C kevm-pyk profile | ||
find /tmp/pytest-of-${USER}/pytest-current/ -type f | sort | xargs tail -n +1 | ||
test-concrete-execution: | ||
if: ${{ github.event.inputs.TestType == 'Concrete Executions' }} | ||
name: 'Build and Test KEVM concrete execution' | ||
runs-on: [self-hosted, linux, normal] | ||
timeout-minutes: 45 | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: 'Set up Docker' | ||
uses: ./.github/actions/with-docker | ||
with: | ||
tag: kevm-ci-concrete-${{ github.sha }} | ||
- name: 'Build kevm-pyk' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make poetry' | ||
- name: 'Build blockchain-k-plugin-deps' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make CXX=clang++-14 plugin-deps' | ||
- name: 'Build kevm' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make build-kevm build-haskell build-llvm build-node -j`nproc` RELEASE=true' | ||
- name: 'Test kevm-pyk' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make test-integration' | ||
- name: 'Test conformance' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make test-conformance' | ||
- name: 'Test llvm krun' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make test-interactive-run TEST_CONCRETE_BACKEND=llvm' | ||
- name: 'Test node' | ||
run: docker exec -u user kevm-ci-concrete-${GITHUB_SHA} /bin/bash -c 'make test-node -j`nproc`' | ||
- name: 'Tear down Docker' | ||
if: always() | ||
run: | | ||
docker stop --time=0 kevm-ci-concrete-${GITHUB_SHA} | ||
test-prove-haskell: | ||
if: ${{ github.event.inputs.TestType == 'Prove Haskell' }} | ||
name: 'Build and Test KEVM haskell proofs' | ||
runs-on: [self-hosted, linux, huge] | ||
timeout-minutes: 120 | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: 'Set up Docker' | ||
uses: ./.github/actions/with-docker | ||
with: | ||
tag: kevm-ci-haskell-${{ github.sha }} | ||
- name: 'Prove Haskell' | ||
run: docker exec -u user kevm-ci-haskell-${GITHUB_SHA} /bin/bash -c 'make test-prove' | ||
- name: 'Tear down Docker' | ||
if: always() | ||
run: | | ||
docker stop --time=0 kevm-ci-haskell-${GITHUB_SHA} | ||
test-prove-foundry: | ||
name: 'Build and Test KEVM Foundry proofs' | ||
runs-on: [self-hosted, linux, huge] | ||
timeout-minutes: 150 | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: 'Set up Docker' | ||
uses: ./.github/actions/with-docker | ||
with: | ||
tag: kevm-ci-foundry-${{ github.sha }} | ||
- name: 'Build kevm-pyk' | ||
run: docker exec -u user kevm-ci-foundry-${GITHUB_SHA} /bin/bash -c 'make poetry' | ||
- name: 'Build Foundry' | ||
run: docker exec -u user kevm-ci-foundry-${GITHUB_SHA} /bin/bash -c 'make build-foundry -j2' | ||
- name: 'Foundry Prove' | ||
run: docker exec -u user kevm-ci-foundry-${GITHUB_SHA} /bin/bash -c 'make test-foundry-prove FOUNDRY_PAR=8' | ||
- name: 'Tear down Docker' | ||
if: always() | ||
run: | | ||
docker stop --time=0 kevm-ci-foundry-${GITHUB_SHA} | ||
test-prove-foundry-booster: | ||
if: ${{ github.event.inputs.TestType == 'Prove Foundry Booster' }} | ||
name: 'Build and Test KEVM Foundry proofs (booster)' | ||
runs-on: [self-hosted, linux, huge] | ||
timeout-minutes: 150 | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: 'Build devShell' | ||
env: | ||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_PUBLIC_TOKEN }} | ||
run: cachix watch-exec k-framework -- nix build --extra-experimental-features 'nix-command flakes' .#devShell.x86_64-linux.inputDerivation --no-link | ||
- name: 'Build blockchain-k-plugin-deps' | ||
run: nix develop --extra-experimental-features 'nix-command flakes' --command make plugin-deps | ||
- name: 'Build kevm-pyk' | ||
run: nix develop --extra-experimental-features 'nix-command flakes' --command make poetry | ||
- name: 'Build Foundry' | ||
run: nix develop --extra-experimental-features 'nix-command flakes' --command make build-foundry -j2 | ||
- name: 'Foundry Prove' | ||
run: nix develop --extra-experimental-features 'nix-command flakes' --command make test-foundry-prove -j2 FOUNDRY_PAR=8 TEST_ARGS=--use-booster | ||
|
||
nix: | ||
if: ${{ github.event.inputs.TestType == 'Nix' }} | ||
name: 'Nix' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- runner: normal | ||
- runner: macos-13 | ||
- runner: ARM64 | ||
runs-on: ${{ matrix.runner }} | ||
timeout-minutes: 60 | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
# Check out pull request HEAD instead of merge commit. | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: 'Install Nix' | ||
if: ${{ matrix.runner == 'macos-13' }} | ||
uses: cachix/install-nix-action@v19 | ||
with: | ||
install_url: https://releases.nixos.org/nix/nix-2.13.3/install | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
substituters = http://cache.nixos.org https://cache.iog.io | ||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= | ||
- name: 'Install Cachix' | ||
if: ${{ matrix.runner == 'macos-13' }} | ||
uses: cachix/cachix-action@v12 | ||
with: | ||
name: k-framework | ||
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }} | ||
- name: 'Build KEVM' | ||
run: GC_DONT_GC=1 nix build --extra-experimental-features 'nix-command flakes' --print-build-logs | ||
- name: 'Test KEVM' | ||
run: GC_DONT_GC=1 nix build --extra-experimental-features 'nix-command flakes' --print-build-logs .#kevm-test | ||
|
||
dockerhub-image-dry-run: | ||
# When TestType is 'DockerHub Image Dry Run', this job will be run. | ||
if: ${{ github.event.inputs.TestType == 'DockerHub Image Dry Run' }} | ||
name: 'Build Ubuntu Jammy DockerHub Image' | ||
runs-on: [self-hosted, linux, normal] | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
ref: ${{ github.event.push.head.sha }} | ||
- name: 'Set up Docker' | ||
uses: ./.github/actions/with-docker | ||
with: | ||
tag: kevm-package-jammy-${{ github.sha }} | ||
- name: 'Build Package' | ||
run: | | ||
set -euxo pipefail | ||
version=$(cat package/version) | ||
docker exec -u user kevm-package-jammy-${GITHUB_SHA} /bin/bash -c 'package/debian/package jammy' | ||
docker exec -u user kevm-package-jammy-${GITHUB_SHA} /bin/bash -c 'ls ..' | ||
docker cp kevm-package-jammy-${GITHUB_SHA}:/home/user/kevm_${version}_amd64.deb ./ | ||
- name: 'Tear down Docker' | ||
if: always() | ||
run: | | ||
docker stop --time=0 kevm-package-jammy-${GITHUB_SHA} | ||
- name: 'Build Docker Image' | ||
run: | | ||
set -euxo pipefail | ||
version=$(cat package/version) | ||
k_version=$(cat deps/k_release) | ||
tag_name="runtimeverificationinc/kevm:ubuntu-jammy-${version}" | ||
container_name="kevm-ci-test-${GITHUB_SHA}" | ||
docker build . --tag ${tag_name} --file package/docker/Dockerfile \ | ||
--build-arg K_VERSION=${k_version} \ | ||
--build-arg KEVM_VERSION=${version} | ||
docker run \ | ||
--name ${container_name} \ | ||
--rm \ | ||
--interactive \ | ||
--tty \ | ||
--detach \ | ||
--user root \ | ||
--workdir /home/user \ | ||
${tag_name} | ||
- name: 'Test Docker Image' | ||
run: | | ||
set -euxo pipefail | ||
version=$(cat package/version) | ||
k_version=$(cat deps/k_release) | ||
container_name="kevm-ci-test-${GITHUB_SHA}" | ||
docker cp ./tests/foundry ${container_name}:/home/user/foundry | ||
docker exec -u user ${container_name} /bin/bash -c "sudo chown user:user -R /home/user/foundry" | ||
docker exec -u user ${container_name} /bin/bash -c "forge build --root foundry" | ||
docker exec -u user ${container_name} /bin/bash -c "kevm foundry-kompile --foundry-project-root foundry --verbose" | ||
docker exec -u user ${container_name} /bin/bash -c "kevm foundry-prove --foundry-project-root foundry --verbose --test AssertTest.test_assert_true_branch" | ||
docker exec -u user ${container_name} /bin/bash -c "kevm foundry-show --foundry-project-root foundry --verbose AssertTest.test_assert_true_branch" | ||
docker exec -u user ${container_name} /bin/bash -c "kevm foundry-list --foundry-project-root foundry --verbose" | ||
docker stop --time=0 ${container_name} |