Adjustments to concrete attributes, Makefile updates (#1929) #357
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: 'Master Push' | |
on: | |
push: | |
branches: | |
- 'master' | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
nix-cache: | |
name: 'Populate Nix Cache' | |
strategy: | |
matrix: | |
include: | |
- runner: normal | |
- runner: macos-13 | |
- runner: ARM64 | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
- name: 'Upgrade bash' | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: brew install bash | |
- 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 }} | |
- name: 'Install Cachix' | |
if: ${{ matrix.runner == 'macos-13' }} | |
uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }} | |
skipPush: true | |
- name: 'Build and cache KEVM' | |
uses: workflow/[email protected] | |
env: | |
GC_DONT_GC: 1 | |
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PUBLIC_TOKEN }}' | |
with: | |
packages: jq | |
script: | | |
kevm=$(nix build --extra-experimental-features 'nix-command flakes' .#kevm --json | jq -r '.[].outputs | to_entries[].value') | |
drv=$(nix-store --query --deriver ${kevm}) | |
nix-store --query --requisites --include-outputs ${drv} | cachix push k-framework | |
dockerhub-image: | |
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} | |
- name: 'Push Docker Image to DockerHub' | |
env: | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
run: | | |
set -euxo pipefail | |
version=$(cat package/version) | |
k_version=$(cat deps/k_release) | |
tag_name="runtimeverificationinc/kevm:ubuntu-jammy-${version}" | |
docker login --username rvdockerhub --password ${DOCKERHUB_PASSWORD} | |
docker image push ${tag_name} | |
make-release: | |
name: 'Cut Release' | |
runs-on: ubuntu-latest | |
needs: [nix-cache, dockerhub-image] | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.push.head.sha }} | |
- name: 'Make Release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.JENKINS_GITHUB_PAT }} | |
run: | | |
set -x | |
kevm_version=v$(cat package/version) | |
gh release create "${kevm_version}" --target "${GITHUB_SHA}" | |
gh-pages: | |
name: 'Publish GH Pages' | |
runs-on: ubuntu-latest | |
needs: make-release | |
steps: | |
- name: 'Check out gh-pages' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
ref: ${{ github.event.push.head.sha }} | |
- run: | | |
git config --global user.email '[email protected]' | |
git config --global user.name 'RV DevOps' | |
- name: 'Publish gh-pages' | |
run: | | |
git checkout -B gh-pages | |
cd web | |
npm install | |
npm run build | |
npm run build-sitemap | |
cd - | |
mv web/public_content ./ | |
rm -rf $(find . -maxdepth 1 -not -name public_content -a -not -name .git -a -not -path . -a -not -path .. -a -not -name CNAME) | |
mv public_content/* ./ | |
rm -rf public_content | |
git add ./ | |
git commit -m 'gh-pages: Updated the website' | |
git merge --strategy ours origin/gh-pages --allow-unrelated-histories | |
git push origin gh-pages |