Update dependency: deps/k_release #245
This file contains hidden or 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 PR' | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-quality-checks: | |
name: 'Code Quality Checks & Unit Tests' | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
- name: 'Install Python' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: 'Get uv release' | |
id: uv_release | |
run: | | |
echo uv_version=$(cat deps/uv_release) >> "${GITHUB_OUTPUT}" | |
- name: 'Install uv' | |
uses: astral-sh/setup-uv@v6 | |
with: | |
version: ${{ steps.uv_release.outputs.uv_version }} | |
- name: 'Run code quality checks' | |
run: make check | |
- name: 'Run pyupgrade' | |
run: make pyupgrade | |
- name: 'Run unit tests' | |
run: make cov-unit | |
integration-tests: | |
name: 'Integration Tests' | |
runs-on: [self-hosted, linux, normal] | |
timeout-minutes: 5 | |
env: | |
CONTAINER: imp-integration-${{ github.sha }} | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
- name: 'Set up Docker' | |
uses: ./.github/actions/with-docker | |
with: | |
container-name: ${CONTAINER} | |
- name: 'Build K definitions' | |
run: docker exec -u user ${CONTAINER} make kdist | |
- name: 'Run integration tests' | |
run: docker exec -u user ${CONTAINER} make cov-integration | |
- name: 'Tear down Docker container' | |
if: always() | |
run: | | |
docker stop --time=0 ${CONTAINER} | |
docker-tests: | |
name: 'Docker Tests' | |
runs-on: [self-hosted, linux, normal] | |
timeout-minutes: 5 | |
env: | |
TAG: ${{ github.sha }} | |
CONTAINER: imp-docker-${{ github.sha }} | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
- name: 'Build Docker image' | |
run: make docker TAG=${TAG} | |
- name: 'Run smoke tests' | |
run: docker run --rm --name ${CONTAINER} ${TAG} ./smoke-test.sh | |
nix: | |
needs: code-quality-checks | |
name: 'Nix Tests' | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: [normal, MacM1] # MacM1 / normal are self-hosted | |
runs-on: ${{ matrix.runner }} | |
timeout-minutes: 60 | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 'Install Nix' | |
if: ${{ matrix.runner != 'MacM1' }} | |
uses: cachix/[email protected] | |
with: | |
install_url: https://releases.nixos.org/nix/nix-2.31.0/install | |
extra_nix_config: | | |
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 != 'MacM1' }} | |
uses: cachix/cachix-action@v16 | |
with: | |
name: k-framework | |
- name: 'Build KIMP' | |
env: | |
NIX_PATH: 'nixpkgs=http://nixos.org/channels/nixos-22.05/nixexprs.tar.xz' | |
GC_DONT_GC: '1' | |
run: | | |
set -euxo pipefail | |
nix --version | |
JQ=$(nix-build '<nixpkgs>' -A jq --no-link)/bin/jq | |
KIMP_BIN=$(nix build .#kimp --print-build-logs --json | $JQ -r '.[].outputs | to_entries[].value')/bin | |
echo $KIMP_BIN >> $GITHUB_PATH | |
- name: 'Run smoke test' | |
run: ./package/smoke-test.sh |