Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ updates:
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
interval: "weekly"
cooldown:
default-days: 7
groups:
actions-dependencies:
patterns:
- "*"
7 changes: 7 additions & 0 deletions .github/pinact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 3
rules:
# Branch refs that must keep tracking their branch: there is no stable tag
# to pin to. The shared ci-workflows actions are consumed from `main`.
- ignore: true
conditions:
- expr: ActionName matches "^argumentcomputer/ci-workflows/"
56 changes: 41 additions & 15 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand All @@ -44,7 +46,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package with mathlib dependency
id: update
Expand All @@ -66,7 +70,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package with nightly
id: update
Expand All @@ -82,9 +88,11 @@ jobs:
run: exit 1

- name: The latest Lean release should be nightly
env:
LATEST_LEAN: ${{ steps.update.outputs.latest_lean }}
run: |
echo "Latest Lean version: ${{ steps.update.outputs.latest_lean }}"
if [[ ! "${{ steps.update.outputs.latest_lean }}" =~ ^nightly- ]]; then
echo "Latest Lean version: $LATEST_LEAN"
if [[ ! "$LATEST_LEAN" =~ ^nightly- ]]; then
echo "Error: The latest_lean output should start with 'nightly-'"
exit 1
fi
Expand All @@ -100,7 +108,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand All @@ -117,7 +127,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand All @@ -138,7 +150,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand Down Expand Up @@ -171,7 +185,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Bump the pinned tag and the toolchain
id: update
Expand Down Expand Up @@ -231,7 +247,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Bump a package whose dependency is commit-pinned
id: update
Expand Down Expand Up @@ -269,7 +287,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Bump the toolchain of a dependency-free package
id: update
Expand Down Expand Up @@ -299,7 +319,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Bump two packages at once
id: update
Expand All @@ -325,10 +347,12 @@ jobs:
fi

- name: The release must be reported as an output
env:
LATEST_LEAN: ${{ steps.update.outputs.latest_lean }}
run: |
echo "latest_lean=${{ steps.update.outputs.latest_lean }}"
echo "latest_lean=$LATEST_LEAN"
expected=$(cut -d: -f2 Fixtures/PinnedTags/lean-toolchain)
if [ "${{ steps.update.outputs.latest_lean }}" != "$expected" ]; then
if [ "$LATEST_LEAN" != "$expected" ]; then
echo "Error: expected $expected"
exit 1
fi
Expand All @@ -343,7 +367,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Bump two packages, excluding one of them
id: update
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/lean_action_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7
- uses: leanprover/lean-action@v1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: leanprover/lean-action@50fcf42d2e460296f1a34b402e990d1b24f8b596 # v1.6.0
env:
GH_TOKEN: ${{ github.token }}

lints:
name: Lint workflows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# actionlint, shellcheck over composite action scripts, pinact (actions
# must be SHA-pinned with a matching version comment) and zizmor
- uses: argumentcomputer/ci-workflows/.github/actions/lint-workflows@main
47 changes: 33 additions & 14 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand All @@ -44,7 +46,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Update Lean package
id: update
uses: ./
Expand All @@ -60,7 +64,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand All @@ -71,18 +77,22 @@ jobs:
lake_package_directory: "./Fixtures/SmokeSuccess"

- name: output assertion of latest_lean
env:
LATEST_LEAN: ${{ steps.update.outputs.latest_lean }}
run: |
echo "Latest Lean version: ${{ steps.update.outputs.latest_lean }}"
if [[ ! "${{ steps.update.outputs.latest_lean }}" =~ ^v ]]; then
echo "Latest Lean version: $LATEST_LEAN"
if [[ ! "$LATEST_LEAN" =~ ^v ]]; then
echo "Error: The latest_lean output should start with 'v'"
exit 1
fi
echo "latest_lean output test passed"

- name: output assertion of notify
env:
NOTIFY: ${{ steps.update.outputs.notify }}
run: |
echo "Notify status: ${{ steps.update.outputs.notify }}"
if [[ "${{ steps.update.outputs.notify }}" != "true" ]]; then
echo "Notify status: $NOTIFY"
if [[ "$NOTIFY" != "true" ]]; then
echo "Error: The notify output should be 'true' for this test case"
echo "This test should have updates available with a successful build"
exit 1
Expand All @@ -93,7 +103,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Update Lean package
id: update
Expand All @@ -104,9 +116,11 @@ jobs:
lake_package_directory: "./Fixtures/HasDep"

- name: output assertion of latest_lean
env:
LATEST_LEAN: ${{ steps.update.outputs.latest_lean }}
run: |
echo "Latest Lean version: ${{ steps.update.outputs.latest_lean }}"
if [[ ! "${{ steps.update.outputs.latest_lean }}" =~ ^v ]]; then
echo "Latest Lean version: $LATEST_LEAN"
if [[ ! "$LATEST_LEAN" =~ ^v ]]; then
echo "Error: The latest_lean output should start with 'v' even when dependencies are present"
exit 1
fi
Expand All @@ -116,7 +130,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Record original lean-toolchain
id: original-toolchain
Expand All @@ -132,18 +148,21 @@ jobs:
update_lean_toolchain: "never"

- name: output assertion of latest_lean
env:
LATEST_LEAN: ${{ steps.update.outputs.latest_lean }}
run: |
echo "Latest Lean version: ${{ steps.update.outputs.latest_lean }}"
if [[ ! "${{ steps.update.outputs.latest_lean }}" =~ ^v ]]; then
echo "Latest Lean version: $LATEST_LEAN"
if [[ ! "$LATEST_LEAN" =~ ^v ]]; then
echo "Error: The latest_lean output should start with 'v' even when update_lean_toolchain is never"
exit 1
fi
echo "latest_lean output test with update_lean_toolchain=never passed"

- name: lean-toolchain should not be updated
env:
ORIGINAL_TOOLCHAIN: ${{ steps.original-toolchain.outputs.content }}
run: |
CURRENT_TOOLCHAIN=$(cat Fixtures/SmokeSuccess/lean-toolchain)
ORIGINAL_TOOLCHAIN="${{ steps.original-toolchain.outputs.content }}"
echo "Original lean-toolchain: $ORIGINAL_TOOLCHAIN"
echo "Current lean-toolchain: $CURRENT_TOOLCHAIN"
if [[ "$CURRENT_TOOLCHAIN" != "$ORIGINAL_TOOLCHAIN" ]]; then
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: cachix/install-nix-action@v31
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31.11.1
with:
github_access_token: ${{ github.token }}

Expand Down
15 changes: 15 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rules:
unpinned-uses:
config:
policies:
# Branch-tracking ref allowed by .github/pinact.yaml
"argumentcomputer/ci-workflows/*": ref-pin
"*": hash-pin
# The test workflows exercise this repository's own action through
# `uses: ./`, the form upstream uses; keeping it avoids a diff on every
# upstream sync.
self-repository:
ignore:
- e2e_test.yml
- test.yaml
- update.yml
14 changes: 0 additions & 14 deletions Fixtures/HasDep/.github/workflows/lean_action_ci.yml

This file was deleted.

14 changes: 0 additions & 14 deletions Fixtures/TwoDeps/.github/workflows/lean_action_ci.yml

This file was deleted.

Loading
Loading