split up fv tests #55
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: CI | |
on: [push] | |
env: | |
NIX_INSTALLABLE_PACKAGE: github:runtimeverification/kup#kup | |
jobs: | |
foundry-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install forge-std | |
run: | | |
forge install foundry-rs/forge-std --no-commit | |
forge remappings > remappings.txt | |
- name: Run non-Kontrol tests | |
run: | | |
forge test --no-match-path "src/test/kontrol/*" -vvv | |
- name: Run snapshot without Kontrol tests | |
run: forge snapshot --no-match-path "src/test/kontrol/*" | |
setup-verification: | |
needs: foundry-test | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 # 1 hour for setup | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
# Install Foundry | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install forge-std and build | |
run: | | |
forge install foundry-rs/forge-std --no-commit | |
forge build --build-info --force | |
forge remappings > remappings.txt | |
- name: Install System Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl gcc git g++ cmake maven openjdk-11-jdk flex \ | |
z3 libz3-dev libsecp256k1-dev python3 python3-pip build-essential | |
# Install Nix | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
extra-conf: | | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE= k-framework-binary.cachix.org-1:pJedQ8iG19BW3v/DMMmiRVtwRBGO3fyMv2Ws0OpBADs= | |
substituters = https://cache.nixos.org https://k-framework.cachix.org | |
# Install Cachix | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
extraPullNames: k-framework-binary | |
- name: Install KUP and Kontrol | |
env: | |
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }} | |
run: | | |
git config --global url."https://${REPOSITORY_TOKEN}:[email protected]/".insteadOf "https://github.com/" | |
echo "Installing kup..." | |
GC_DONT_GC=1 nix profile install github:runtimeverification/kup#kup \ | |
--option extra-substituters 'https://k-framework.cachix.org' \ | |
--option extra-trusted-public-keys 'k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE=' \ | |
--experimental-features 'nix-command flakes' | |
export PATH="$HOME/.nix-profile/bin:$PATH" | |
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH | |
echo "Verifying kup installation..." | |
which kup || { echo "kup not found in PATH"; exit 1; } | |
kup list || { echo "kup not working properly"; exit 1; } | |
echo "Installing Kontrol..." | |
GITHUB_TOKEN=$REPOSITORY_TOKEN kup install kontrol | |
echo "Verifying Kontrol installation..." | |
which kontrol || { echo "kontrol not found in PATH"; exit 1; } | |
kontrol version || { echo "kontrol not working properly"; exit 1; } | |
- name: Run Setup Verification | |
run: | | |
mkdir -p verification-results | |
echo "Building Kontrol project..." | |
kontrol build --verbose | |
echo "Running setup verification..." | |
kontrol prove --config-profile setup --verbose | |
- name: Upload Setup Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: setup-verification-results | |
path: | | |
verification-results/ | |
.build/ | |
.kontrol/ | |
retention-days: 5 | |
repo-token-tests: | |
needs: setup-verification | |
runs-on: ubuntu-latest | |
timeout-minutes: 350 # Maximum safe timeout for GitHub-hosted runners | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install forge-std and build | |
run: | | |
forge install foundry-rs/forge-std --no-commit | |
forge build --build-info --force | |
forge remappings > remappings.txt | |
- name: Install System Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl gcc git g++ cmake maven openjdk-11-jdk flex \ | |
z3 libz3-dev libsecp256k1-dev python3 python3-pip build-essential | |
# Install Nix | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
extra-conf: | | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE= k-framework-binary.cachix.org-1:pJedQ8iG19BW3v/DMMmiRVtwRBGO3fyMv2Ws0OpBADs= | |
substituters = https://cache.nixos.org https://k-framework.cachix.org | |
# Install Cachix | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
extraPullNames: k-framework-binary | |
- name: Install KUP and Kontrol | |
env: | |
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }} | |
run: | | |
git config --global url."https://${REPOSITORY_TOKEN}:[email protected]/".insteadOf "https://github.com/" | |
echo "Installing kup..." | |
GC_DONT_GC=1 nix profile install github:runtimeverification/kup#kup \ | |
--option extra-substituters 'https://k-framework.cachix.org' \ | |
--option extra-trusted-public-keys 'k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE=' \ | |
--experimental-features 'nix-command flakes' | |
export PATH="$HOME/.nix-profile/bin:$PATH" | |
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH | |
echo "Installing Kontrol..." | |
GITHUB_TOKEN=$REPOSITORY_TOKEN kup install kontrol | |
echo "Verifying Kontrol installation..." | |
which kontrol || { echo "kontrol not found in PATH"; exit 1; } | |
kontrol version || { echo "kontrol not working properly"; exit 1; } | |
- name: Download Setup Results | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-verification-results | |
path: . | |
- name: Run RepoToken Tests | |
run: | | |
mkdir -p verification-results | |
echo "Building Kontrol project..." | |
kontrol build --verbose | |
echo "Running RepoToken tests..." | |
kontrol prove \ | |
--verbose \ | |
--include "src%test%kontrol%RepoTokenListInvariantsTest.*" \ | |
--config-profile tests | |
- name: Upload RepoToken Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: repo-token-verification-results | |
path: | | |
verification-results/ | |
.build/ | |
.kontrol/ | |
retention-days: 5 | |
term-auction-tests: | |
needs: setup-verification | |
runs-on: ubuntu-latest | |
timeout-minutes: 350 # Maximum safe timeout for GitHub-hosted runners | |
steps: | |
# Copy all installation steps from repo-token-tests | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install forge-std and build | |
run: | | |
forge install foundry-rs/forge-std --no-commit | |
forge build --build-info --force | |
forge remappings > remappings.txt | |
- name: Install System Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl gcc git g++ cmake maven openjdk-11-jdk flex \ | |
z3 libz3-dev libsecp256k1-dev python3 python3-pip build-essential | |
# Install Nix | |
- uses: DeterminateSystems/nix-installer-action@main | |
with: | |
extra-conf: | | |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE= k-framework-binary.cachix.org-1:pJedQ8iG19BW3v/DMMmiRVtwRBGO3fyMv2Ws0OpBADs= | |
substituters = https://cache.nixos.org https://k-framework.cachix.org | |
# Install Cachix | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
extraPullNames: k-framework-binary | |
- name: Install KUP and Kontrol | |
env: | |
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }} | |
run: | | |
git config --global url."https://${REPOSITORY_TOKEN}:[email protected]/".insteadOf "https://github.com/" | |
echo "Installing kup..." | |
GC_DONT_GC=1 nix profile install github:runtimeverification/kup#kup \ | |
--option extra-substituters 'https://k-framework.cachix.org' \ | |
--option extra-trusted-public-keys 'k-framework.cachix.org-1:jeyMXB2h28gpNRjuVkehg+zLj62ma1RnyyopA/20yFE=' \ | |
--experimental-features 'nix-command flakes' | |
export PATH="$HOME/.nix-profile/bin:$PATH" | |
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH | |
echo "Installing Kontrol..." | |
GITHUB_TOKEN=$REPOSITORY_TOKEN kup install kontrol | |
echo "Verifying Kontrol installation..." | |
which kontrol || { echo "kontrol not found in PATH"; exit 1; } | |
kontrol version || { echo "kontrol not working properly"; exit 1; } | |
- name: Download Setup Results | |
uses: actions/download-artifact@v3 | |
with: | |
name: setup-verification-results | |
path: . | |
- name: Run TermAuction Tests | |
run: | | |
mkdir -p verification-results | |
echo "Building Kontrol project..." | |
kontrol build --verbose | |
echo "Running TermAuction tests..." | |
kontrol prove \ | |
--verbose \ | |
--include "src%test%kontrol%TermAuctionListInvariantsTest.*" \ | |
--config-profile tests | |
- name: Upload TermAuction Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: term-auction-verification-results | |
path: | | |
verification-results/ | |
.build/ | |
.kontrol/ | |
retention-days: 5 | |
results-summary: | |
needs: [setup-verification, repo-token-tests, term-auction-tests] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Download All Results | |
uses: actions/download-artifact@v3 | |
with: | |
path: all-results | |
- name: Generate Summary | |
run: | | |
echo "# Kontrol Verification Summary" > summary.md | |
echo "## Setup Verification" >> summary.md | |
find all-results/setup-verification-results -type f -name "*.out" -exec cat {} \; >> summary.md 2>/dev/null || echo "No setup results found" >> summary.md | |
echo "## RepoToken Tests" >> summary.md | |
find all-results/repo-token-verification-results -type f -name "*.out" -exec cat {} \; >> summary.md 2>/dev/null || echo "No RepoToken results found" >> summary.md | |
echo "## TermAuction Tests" >> summary.md | |
find all-results/term-auction-verification-results -type f -name "*.out" -exec cat {} \; >> summary.md 2>/dev/null || echo "No TermAuction results found" >> summary.md | |
- name: Upload Summary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: verification-summary | |
path: summary.md | |
retention-days: 5 |