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
28 changes: 28 additions & 0 deletions .github/actions/green/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Green
description: >-
Leave the markers of a unit that passed, so that a later run with the same
key skips it (ci/plan.py).
inputs:
unit:
description: The unit as ci/plan.py gives it, as JSON
required: true
runs:
using: composite
steps:
- id: marker
shell: bash
env:
UNIT: ${{ inputs.unit }}
run: |
mkdir -p "$RUNNER_TEMP/green"
echo "$GITHUB_SHA" > "$RUNNER_TEMP/green/commit"
python3 -c 'import json, os; unit = json.loads(os.environ["UNIT"]); print("key=" + unit["key"]); print("also=" + (unit["also"][0] if unit["also"] else ""))' >> "$GITHUB_OUTPUT"
- uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/green
key: ${{ steps.marker.outputs.key }}
- if: steps.marker.outputs.also != ''
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/green
key: ${{ steps.marker.outputs.also }}
25 changes: 25 additions & 0 deletions .github/actions/rust-save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Save the Rust build
description: >-
Keep the target directory for the next runs, with the tree it was built
from. Only main saves: a pull request reads main's and leaves its own.
inputs:
cache:
description: The name of the cache, as given to the rust action
required: true
runs:
using: composite
steps:
- name: Record the tree
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
shell: bash
run: python3 ci/mtimes.py save target
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
provision/ansible/roles/devbox/files/bin
key: cargo-${{ inputs.cache }}-${{ hashFiles('Cargo.lock', 'ci/dev.Dockerfile') }}-${{ github.sha }}
34 changes: 34 additions & 0 deletions .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Rust
description: >-
The toolchain of ci/dev.Dockerfile, and cargo's downloads and the target
directory from the cache of main, with the times of the files that did not
change set back so cargo builds only what did (ci/mtimes.py).
inputs:
cache:
description: The name of the cache, one for each kind of build
required: true
runs:
using: composite
steps:
- name: Install the toolchain
shell: bash
run: |
version=$(sed -n 's/^FROM rust:\([0-9.]*\)-.*/\1/p' ci/dev.Dockerfile)
rustup toolchain install "$version" --profile minimal \
--component clippy,rustfmt --target x86_64-unknown-linux-musl --no-self-update
echo "RUSTUP_TOOLCHAIN=$version" >> "$GITHUB_ENV"
- name: Restore the build
id: restore
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
provision/ansible/roles/devbox/files/bin
key: cargo-${{ inputs.cache }}-${{ hashFiles('Cargo.lock', 'ci/dev.Dockerfile') }}-${{ github.sha }}
restore-keys: cargo-${{ inputs.cache }}-${{ hashFiles('Cargo.lock', 'ci/dev.Dockerfile') }}-
- name: Keep the times of what did not change
shell: bash
run: python3 ci/mtimes.py restore target
14 changes: 10 additions & 4 deletions .github/workflows/boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@ on:
paths:
- 'provision/**'
- 'plugins/**'
- 'ci/**'
- 'tests/e2e/boot_*'
- 'ci/boot*'
- 'ci/run.sh'
- 'ci/dev.Dockerfile*'
- 'tests/e2e/boot*'
- 'tests/e2e/vm.py'
- 'container/**'
- '.github/workflows/boot.yml'
push:
branches: [main]
paths:
- 'provision/**'
- 'plugins/**'
- 'ci/**'
- 'tests/e2e/boot_*'
- 'ci/boot*'
- 'ci/run.sh'
- 'ci/dev.Dockerfile*'
- 'tests/e2e/boot*'
- 'tests/e2e/vm.py'
- 'container/**'
- '.github/workflows/boot.yml'
workflow_dispatch:
Expand Down
Loading
Loading