diff --git a/.github/scripts/check-cachix-pin.sh b/.github/scripts/check-cachix-pin.sh deleted file mode 100755 index 528d11c0..00000000 --- a/.github/scripts/check-cachix-pin.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Kup relies on cachix registry k-framework-binary. -CACHE="k-framework-binary" -OWNER_REPO="${OWNER_REPO:-$(git remote get-url origin | sed -E 's#(git@github.com:|https://github.com/)##; s#\.git$##')}" -REV="${REV:-${GITHUB_SHA:-$(git rev-parse HEAD)}}" -UNAME_S="$(uname -s)" -UNAME_M="$(uname -m)" -case "${UNAME_S}-${UNAME_M}" in - Linux-x86_64) SYSTEM="x86_64-linux" ;; - Linux-aarch64 | Linux-arm64) SYSTEM="aarch64-linux" ;; - Darwin-x86_64) SYSTEM="x86_64-darwin" ;; - Darwin-arm64) SYSTEM="aarch64-darwin" ;; - *) - echo "Unsupported platform: ${UNAME_S}-${UNAME_M}" >&2 - exit 1 - ;; -esac -PIN_API_URL="https://app.cachix.org/api/v1/cache/${CACHE}/pin" -CHECK_PACKAGES=(stable-mir-json) - -SUMMARY="${GITHUB_STEP_SUMMARY:-/dev/stdout}" - -{ - echo "## Cachix Publish Summary" - echo "CACHE: $CACHE" - echo "OWNER_REPO: $OWNER_REPO" - echo "REV: $REV" - echo "SYSTEM: $SYSTEM" - echo "PACKAGES: ${CHECK_PACKAGES[*]}" -} >> "$SUMMARY" - -# Verify push + pin together for each package. Both can become visible with delay. -PIN_VISIBILITY_TIMEOUT_SECONDS=120 # 2 minutes -PIN_VISIBILITY_INTERVAL_SECONDS=5 # 5 seconds -PIN_VISIBILITY_ATTEMPTS=$((PIN_VISIBILITY_TIMEOUT_SECONDS / PIN_VISIBILITY_INTERVAL_SECONDS)) -for i in $(seq 1 "$PIN_VISIBILITY_ATTEMPTS"); do - PIN_JSON="$(curl -fsSL "${PIN_API_URL}?q=${REV}")" - ALL_OK=1 - - for PKG in "${CHECK_PACKAGES[@]}"; do - KEY="github:${OWNER_REPO}/${REV}#packages.${SYSTEM}.${PKG}" - STORE_PATH="$( - echo "$PIN_JSON" \ - | jq -r --arg k "$KEY" 'map(select(.name == $k)) | first | (.lastRevision.storePath // .storePath // .store_path // .path // "")' - )" - if [ -z "$STORE_PATH" ]; then - PIN_STATUS="pin-missing" - PUSH_STATUS="000" - ALL_OK=0 - { - echo "key-${PKG}: ${KEY}" - echo "pin-status-${PKG}: ${PIN_STATUS}" - echo "push-http-${PKG}: ${PUSH_STATUS}" - } - continue - fi - - PIN_STATUS="pin-ok" - HASH="$(basename "$STORE_PATH" | cut -d- -f1)" - PUSH_NARINFO_URL="https://${CACHE}.cachix.org/${HASH}.narinfo" - PUSH_STATUS="$(curl -sS -o /dev/null -w '%{http_code}' "$PUSH_NARINFO_URL")" || PUSH_STATUS="000" - if [ "$PUSH_STATUS" != "200" ]; then - ALL_OK=0 - fi - - { - echo "key-${PKG}: ${KEY}" - echo "store-path-${PKG}: ${STORE_PATH}" - echo "pin-status-${PKG}: ${PIN_STATUS}" - echo "push-http-${PKG}: ${PUSH_STATUS}" - } - done - - if [ "$ALL_OK" = "1" ]; then - echo "cachix-status: push-and-pin-ok-for-all-packages" >> "$SUMMARY" - exit 0 - fi - - echo "cachix-check-attempt-${i}: not-ready, retrying in ${PIN_VISIBILITY_INTERVAL_SECONDS}s" - sleep "$PIN_VISIBILITY_INTERVAL_SECONDS" -done - -echo "cachix-status: push-or-pin-missing-after-${PIN_VISIBILITY_TIMEOUT_SECONDS}s-for-at-least-one-package" >> "$SUMMARY" -exit 1 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml deleted file mode 100644 index fe86a894..00000000 --- a/.github/workflows/master.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: 'Master Release' -on: - push: - branches: [ "master" ] - workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_TERM_COLOR: always - -jobs: - update-deps: - name: "Update Dependents" - runs-on: [self-hosted, linux, normal] - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: - ref: ${{ github.event.push.head.sha }} - fetch-depth: 0 - - name: 'Update dependents' - run: | - set -x - VERSION=$(git rev-parse HEAD) - curl --fail \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.JENKINS_GITHUB_PAT }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/runtimeverification/devops/dispatches \ - -d '{"event_type":"on-demand-test","client_payload":{"repo":"runtimeverification/stable-mir-json","version":"'${VERSION}'"}}' - - nix-cache: - name: 'Populate Nix Cache' - strategy: - matrix: - runner: [normal, ARM64] - runs-on: ${{ matrix.runner }} - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: - ref: ${{ github.event.push.head.sha }} - fetch-depth: 0 - - - name: 'Build and cache stable-mir-json' - uses: workflow/nix-shell-action@v3 - env: - GC_DONT_GC: 1 - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_PUBLIC_TOKEN }} - with: - packages: jq - script: | - STABLE_MIR_JSON=$(nix build --extra-experimental-features 'nix-command flakes' .#stable-mir-json --json | jq -r '.[].outputs | to_entries[].value') - DRV=$(nix-store --query --deriver ${STABLE_MIR_JSON}) - nix-store --query --requisites --include-outputs ${DRV} | cachix push k-framework - - nix-binary-cache: - name: 'Populate Nix Binary Cache' - strategy: - matrix: - runner: [normal, ARM64] - runs-on: ${{ matrix.runner }} - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - with: - ref: ${{ github.event.push.head.sha }} - fetch-depth: 0 - - - name: 'Publish stable-mir-json to k-framework-binary cache' - uses: workflow/nix-shell-action@v3 - env: - CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PRIVATE_KFB_TOKEN }}' - GC_DONT_GC: '1' - with: - packages: jq - script: | - export PATH="$(nix build github:runtimeverification/kup --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH" - kup publish k-framework-binary .#stable-mir-json --keep-days 180 || true - - bash .github/scripts/check-cachix-pin.sh diff --git a/.github/workflows/test-cachix-pin.yml b/.github/workflows/test-cachix-pin.yml deleted file mode 100644 index 9ee32cfa..00000000 --- a/.github/workflows/test-cachix-pin.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: 'Test Cachix Pin' - -on: - workflow_dispatch: - inputs: - ref: - description: 'Git ref (tag or SHA) of an existing release to verify' - required: true - type: string - -jobs: - verify-cachix-pin: - name: 'Verify Cachix Pin' - runs-on: [self-hosted, linux, normal] - steps: - - name: 'Check out code' - uses: actions/checkout@v4 - - - name: 'Verify cachix publish and pin' - uses: workflow/nix-shell-action@v3 - env: - CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PRIVATE_KFB_TOKEN }}' - GC_DONT_GC: '1' - OWNER_REPO: '${{ github.repository }}' - REV: '${{ inputs.ref }}' - with: - packages: jq - script: bash .github/scripts/check-cachix-pin.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf425808..0fceb1f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,10 @@ env: jobs: code-quality: name: "Code Quality" - runs-on: [self-hosted, linux, normal] + runs-on: ubuntu-latest steps: - name: 'Check out code' - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: # Check out pull request HEAD instead of merge commit. ref: ${{ github.event.pull_request.head.sha }} @@ -56,7 +56,7 @@ jobs: cargo fmt --check - name: 'Install Nix' - uses: cachix/install-nix-action@v31.5.1 + uses: cachix/install-nix-action@v31.11.0 with: install_url: https://releases.nixos.org/nix/nix-2.30.1/install extra_nix_config: | @@ -70,11 +70,11 @@ jobs: integration-tests: needs: code-quality - name: "Integration tests" - runs-on: [self-hosted, linux, normal] + name: "Integration Tests" + runs-on: ubuntu-latest steps: - name: 'Check out code' - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: # Check out pull request HEAD instead of merge commit. ref: ${{ github.event.pull_request.head.sha }} @@ -104,7 +104,7 @@ jobs: RUSTFLAGS='--deny warnings' cargo build -vv - name: 'Install a good-enough jq version' - uses: dcarbone/install-jq-action@v3 + uses: dcarbone/install-jq-action@v4 with: version: 1.7.1 force: true @@ -117,11 +117,11 @@ jobs: ui-tests: needs: code-quality - name: "ui-tests" - runs-on: [self-hosted, linux, normal] + name: "UI Tests" + runs-on: ubuntu-latest steps: - name: 'Check out code' - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: # Check out pull request HEAD instead of merge commit. ref: ${{ github.event.pull_request.head.sha }} @@ -158,7 +158,7 @@ jobs: echo "rustc-commit=$COMMIT" >> "$GITHUB_OUTPUT" - name: 'Check out Rust repo' - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: repository: rust-lang/rust ref: ${{ steps.rustc-meta.outputs.rustc-commit }} @@ -169,7 +169,7 @@ jobs: run: | # Warning check should be redundant since code-quality runs first RUSTFLAGS='--deny warnings' cargo build -vv - - name: 'Run smir integration tests' + - name: 'Run smir UI tests' run: | RUST_DIR_ROOT='rust' VERBOSE=1 make test-ui @@ -184,7 +184,7 @@ jobs: timeout-minutes: 20 steps: - name: 'Check out code' - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: # Check out pull request HEAD instead of merge commit. ref: ${{ github.event.pull_request.head.sha }} @@ -192,7 +192,7 @@ jobs: - name: 'Install Nix' if: ${{ matrix.runner != 'MacM1' }} - uses: cachix/install-nix-action@v31.5.1 + uses: cachix/install-nix-action@v31.11.0 with: install_url: https://releases.nixos.org/nix/nix-2.30.1/install extra_nix_config: | @@ -201,7 +201,7 @@ jobs: - name: 'Install Cachix' if: ${{ matrix.runner != 'MacM1' }} - uses: cachix/cachix-action@v16 + uses: cachix/cachix-action@v17 with: name: k-framework diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml deleted file mode 100644 index 35ffa8a0..00000000 --- a/.github/workflows/update-version.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -name: 'Update Version' -on: - push: - branches: - - '_update-deps/runtimeverification/rv-nix-tools' - workflow_dispatch: -# Stop in progress workflows on the same branch and same workflow to use latest committed code -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - update-versions: - name: 'Update Dependency Versions' - runs-on: ubuntu-latest - steps: - - name: 'Check out code' - uses: actions/checkout@v3 - with: - submodules: recursive - token: ${{ secrets.JENKINS_GITHUB_PAT }} - fetch-depth: 0 - - name: 'Configure GitHub user' - run: | - git config user.name devops - git config user.email devops@runtimeverification.com - - name: 'Install Nix' - uses: cachix/install-nix-action@v31.5.1 - with: - install_url: https://releases.nixos.org/nix/nix-2.30.1/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= - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - uses: cachix/cachix-action@v16 - with: - name: k-framework - authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }} - - name: 'Update Nix flake inputs' - run: | - RV_NIX_TOOLS_VERSION=$(cat deps/rv-nix-tools) - sed -i 's! rv-nix-tools.url = "github:runtimeverification/rv-nix-tools/[a-z0-9\.]*"! rv-nix-tools.url = "github:runtimeverification/rv-nix-tools/'"${RV_NIX_TOOLS_VERSION}"'"!' flake.nix - nix flake update - git add flake.nix flake.lock && git commit -m 'flake.{nix,lock}: update Nix derivations' || true - - name: 'Push updates' - run: git push