Skip to content

Commit

Permalink
Clean up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-noland committed Nov 5, 2024
1 parent 322584e commit 2212f85
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 162 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: build
name: "build.yml"
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
type: "boolean"
description: "Run the build with tmate debugging enabled"
merge_group:
pull_request:
Expand All @@ -12,7 +12,7 @@ on:
- "main"

concurrency:
group: ${{ github.workflow }}
group: "${{ github.workflow }}"

jobs:
matrix:
Expand All @@ -22,25 +22,25 @@ jobs:
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: cargo-bins/cargo-binstall@main
- name: install whyq
- uses: "actions/checkout@v4"
- uses: "dtolnay/rust-toolchain@stable"
- uses: "cargo-bins/cargo-binstall@main"
- name: "install whyq"
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install --yes --no-install-recommends jq
cargo binstall --no-confirm whyq
- name: generate test matrix
id: matrix
- name: "generate test matrix"
id: "matrix"
run: |
set -euxo pipefail
yq \
--compact-output \
--raw-output \
'"matrix=" + (.matrix | tostring)' builds.yml \
| tee -a "${GITHUB_OUTPUT}"
- name: report build plan
- name: "report build plan"
run: |
cat >> "${GITHUB_STEP_SUMMARY}" <<EOF
# Action plan
Expand Down Expand Up @@ -94,45 +94,48 @@ jobs:
EOF
run:
name: run
needs: matrix
name: "run"
needs: "matrix"
runs-on:
- lab
- "lab"
timeout-minutes: 300
strategy:
max-parallel: 3
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: install nix
uses: cachix/install-nix-action@v30
- name: login to ghcr.io
uses: docker/login-action@v3
- uses: "actions/checkout@v4"
- name: "install nix"
uses: "cachix/install-nix-action@v30"
- name: "login to ghcr.io"
uses: "docker/login-action@v3"
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- uses: "dtolnay/rust-toolchain@stable"
- uses: "cargo-bins/cargo-binstall@main"
- run: |
cargo binstall --no-confirm just
- name: nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: confirm sources
run: ./scripts/confirm-sources.sh
- name: build + push
run: just --yes debug=true max_nix_builds=1 rust=${{matrix.toolchain.key}} push
- name: Install SBOM generator dependencies
- name: "nix cache"
uses: "DeterminateSystems/magic-nix-cache-action@main"
- name: "confirm sources"
run: |
./scripts/confirm-sources.sh
- name: "build + push"
run: |
just --yes debug=true max_nix_builds=1 rust=${{matrix.toolchain.key}} push
- name: "Install SBOM generator dependencies"
run: |
for f in /tmp/dpdk-sys/builds/*; do
[ -h "$f" ] && rm "$f"
done
cargo binstall --no-confirm csview
sudo apt-get update
sudo apt-get install --yes --no-install-recommends graphviz
- name: Generate SBOM
run: ./scripts/sbom.sh
- name: step summary
- name: "Generate SBOM"
run: |
./scripts/sbom.sh
- name: "step summary"
continue-on-error: true # might fail due to $GITHUB_STEP_SUMMARY size limit of 1MB
run: |
echo "# Outdated packages:" >> "$GITHUB_STEP_SUMMARY"
Expand All @@ -150,30 +153,32 @@ jobs:
cat /tmp/dpdk-sys/builds/env.sysroot.gnu64.sbom.md >> $GITHUB_STEP_SUMMARY
echo "" >> "$GITHUB_STEP_SUMMARY"
- name: remove links from /tmp/dpdk-sys/builds
- name: "remove links from /tmp/dpdk-sys/builds"
run: |
for f in /tmp/dpdk-sys/builds/*; do
[ -h "$f" ] && rm "$f"
done
- uses: actions/upload-artifact@v4
- uses: "actions/upload-artifact@v4"
with:
name: builds-${{ matrix.toolchain.key }}
path: /tmp/dpdk-sys/builds
- name: Setup tmate session for debug
name: "builds-${{ matrix.toolchain.key }}"
path: "/tmp/dpdk-sys/builds"
- name: "Setup tmate session for debug"
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
uses: "mxschmitt/action-tmate@v3"
timeout-minutes: 60
with:
limit-access-to-actor: true

summary:
name: summary
name: "summary"
if: ${{ always() }}
runs-on:
- lab
- "lab"
needs:
- run
steps:
- name: Flag any build matrix failures
- name: "Flag any build matrix failures"
if: ${{ needs.run.result != 'success' }}
run: exit 1
run: |
>&2 echo "A critical step failed!"
exit 1
18 changes: 12 additions & 6 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: "bump"
on:
workflow_dispatch:
inputs:
branch:
dpdk_sys_branch:
type: "string"
default: "main"
description: "which branch to bump"
Expand All @@ -22,6 +22,9 @@ on:
branches:
- "main"

env:
dpdk_sys_branch: ${{ github.event.inputs.dpdk_sys_branch || 'main' }}

permissions:
contents: "write"
pull-requests: "write"
Expand All @@ -34,18 +37,21 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: "${{ github.event.inputs.branch || 'main' }}"
ref: "${{ env.dpdk_sys_branch }}"
- uses: "dtolnay/rust-toolchain@stable"
- uses: "cargo-bins/cargo-binstall@main"
- run: "cargo binstall --no-confirm just"
- run: |
cargo binstall --no-confirm just
- name: "install nix"
uses: "cachix/install-nix-action@v30"
- run: "./scripts/update-version-pinning.sh"
- name: "bump"
run: |
just dpdk_sys_branch="${{ env.dpdk_sys_branch }}" bump
- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v7"
with:
branch: "bump/${{ github.event.inputs.branch || 'main' }}"
title: "bump/${{ github.event.inputs.branch || 'main' }}"
branch: "bump/${{ env.dpdk_sys_branch }}"
title: "bump/${{ env.dpdk_sys_branch }}"
labels: |
automated
dependencies
Expand Down
14 changes: 7 additions & 7 deletions builds.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ matrix:
- "x86_64-unknown-linux-gnu"
- "x86_64-unknown-linux-musl"
just: *just_version
# - # pinned nightly
# <<: *default
# key: "nightly"
# llvm: *llvm_nightly
# rust:
# channel: "nightly"
# version: *nightly_pin
- # pinned nightly
<<: *default
key: "nightly"
llvm: *llvm_nightly
rust:
channel: "nightly"
version: *nightly_pin
nixpkgs:
- *nixpkgs_unstable
14 changes: 7 additions & 7 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ matrix:
- "x86_64-unknown-linux-gnu"
- "x86_64-unknown-linux-musl"
just: *just_version
# - # pinned nightly
# <<: *default
# key: "nightly"
# llvm: *llvm_nightly
# rust:
# channel: "nightly"
# version: *nightly_pin
- # pinned nightly
<<: *default
key: "nightly"
llvm: *llvm_nightly
rust:
channel: "nightly"
version: *nightly_pin
nixpkgs:
- *nixpkgs_unstable
Loading

0 comments on commit 2212f85

Please sign in to comment.