Prune #Bottom states when branching #5022
Workflow file for this run
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: "Test" | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ghc_version: "9.2.8" | |
stack_version: "2.9.3" | |
jobs: | |
formatting: | |
name: 'Auto-formatting' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
submodules: recursive | |
token: ${{ secrets.JENKINS_GITHUB_PAT }} | |
- name: 'Install Nix' | |
uses: cachix/install-nix-action@v22 | |
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' | |
uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}' | |
- name: Format | |
run: | | |
nix run .#format | |
- name: Update branch | |
env: | |
GITHUB_EVENT_NAME: ${{ github.event_name }} | |
run: | | |
if git status -s -b | grep -q '^##.*(no branch)$'; then | |
echo 2>&1 "Error: Git is in detached HEAD state" | |
exit 1 | |
fi | |
if [ -n "$(git status --porcelain '*.hs')" ]; then | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
git add '*.hs' | |
git commit -m "Format with fourmolu" | |
git show --stat | |
git push | |
echo "Reformatted code pushed, aborting this workflow" | tee -a $GITHUB_STEP_SUMMARY | |
exit 1 | |
fi | |
nix-build: | |
name: 'Nix / Unit Tests' | |
needs: formatting | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- runner: ubuntu-22.04 | |
os: ubuntu-22.04 | |
nix: x86_64-linux | |
- runner: macos-12 | |
os: macos-12 | |
nix: x86_64-darwin | |
- runner: MacM1 | |
os: self-macos-12 | |
nix: aarch64-darwin | |
runs-on: ${{ matrix.runner }} | |
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 }} | |
submodules: recursive | |
- name: 'Upgrade bash' | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: brew install bash | |
# Do the Following only on Public Runners; Mac Runner is pre-installed with build tools | |
- name: 'Install Nix' | |
if: ${{ !startsWith(matrix.os, 'self') }} | |
uses: cachix/install-nix-action@v22 | |
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: ${{ !startsWith(matrix.os, 'self') }} | |
uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
authToken: '${{ secrets.CACHIX_PUBLIC_TOKEN }}' | |
- name: Build | |
run: GC_DONT_GC=1 nix-build -A project.${{ matrix.nix }}.kore.components.exes | |
- name: Check shell | |
run: GC_DONT_GC=1 nix develop --print-build-logs --command cabal --version | |
- name: Run unit tests | |
run: GC_DONT_GC=1 nix-build -A project.${{ matrix.nix }}.kore.checks | |
nix-integration: | |
name: 'Nix / Integration' | |
runs-on: [self-hosted, linux, normal] | |
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 }} | |
submodules: recursive | |
- name: Install Nix | |
uses: cachix/install-nix-action@v22 | |
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 | |
uses: cachix/cachix-action@v12 | |
with: | |
name: k-framework | |
skipPush: true | |
- name: Run integration tests | |
run: | | |
nix develop github:runtimeverification/k/v$(cat deps/k_release)#kore-integration-tests \ | |
--override-input haskell-backend . --update-input haskell-backend \ | |
--command bash -c "cd test && make -j2 --output-sync test" | |
cabal: | |
name: 'Cabal / Unit Tests' | |
needs: formatting | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install prerequisites | |
run: | | |
sudo apt install --yes z3 | |
- uses: actions/checkout@v3 | |
with: | |
# Check out pull request HEAD instead of merge commit. | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: Cache Cabal package database and store | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cabal/packages | |
~/.cabal/store | |
key: cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('cabal.project') }}-${{ hashFiles('cabal.project.freeze') }}-${{ hashFiles('kore/kore.cabal') }}-${{ hashFiles('kore-rpc-types/kore-rpc-types.cabal') }} | |
restore-keys: | | |
cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('cabal.project') }}-${{ hashFiles('cabal.project.freeze') }}-${{ hashFiles('kore/kore.cabal') }} | |
cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('cabal.project') }}-${{ hashFiles('cabal.project.freeze') }} | |
cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('cabal.project') }} | |
cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }} | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell-cabal | |
with: | |
ghc-version: ${{ env.ghc_version }} | |
cabal-version: "3.6" | |
- name: Run unit tests | |
run: cabal v2-test --enable-tests --test-show-details=direct all | |
- name: Configure with profiling | |
run: cabal v2-configure --enable-profiling -f-threaded | |
stack: | |
name: 'Stack / Unit Tests' | |
needs: formatting | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install prerequisites | |
run: | | |
sudo apt install --yes z3 | |
- uses: actions/checkout@v3 | |
with: | |
# Check out pull request HEAD instead of merge commit. | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: Cache Stack root | |
uses: actions/cache@v3 | |
with: | |
path: ~/.stack | |
key: stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }} | |
restore-keys: | | |
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }} | |
stack-2-${{ runner.os }}-ghc-${{ env.ghc_version }} | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell-stack | |
with: | |
ghc-version: ${{ env.ghc_version }} | |
stack-version: ${{ env.stack_version }} | |
enable-stack: true | |
stack-setup-ghc: true | |
- name: Build dependencies | |
run: | | |
stack build --test --only-dependencies | |
if [ -n "$(git status --porcelain)" ]; then | |
git diff | |
exit 1 | |
fi | |
- name: Run unit tests | |
run: stack test --pedantic | |
stack-haddock: | |
name: 'Stack / Haddock check' | |
needs: formatting | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install prerequisites | |
run: | | |
sudo apt install --yes z3 | |
- uses: actions/checkout@v3 | |
with: | |
# Check out pull request HEAD instead of merge commit. | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: Cache Stack root | |
uses: actions/cache@v3 | |
with: | |
path: ~/.stack | |
key: stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }} | |
restore-keys: | | |
stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }} | |
stack-haddock-2-${{ runner.os }}-ghc-${{ env.ghc_version }} | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell-stack | |
with: | |
ghc-version: ${{ env.ghc_version }} | |
stack-version: ${{ env.stack_version }} | |
enable-stack: true | |
stack-setup-ghc: true | |
- name: Build documentation | |
run: | | |
stack haddock --fast | |
hlint: | |
name: 'HLint' | |
needs: formatting | |
runs-on: ubuntu-22.04 | |
env: | |
hlint_version: "3.5" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Check out pull request HEAD instead of merge commit. | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: Download hlint | |
run: curl -sSL https://github.com/ndmitchell/hlint/releases/download/v${{ env.hlint_version }}/hlint-${{ env.hlint_version }}-x86_64-linux.tar.gz | tar xvz | |
- name: Run hlint | |
run: hlint-${{ env.hlint_version }}/hlint kore kore-rpc-types -j |