Skip to content

Commit a4bda72

Browse files
bootc-dev Botcgwalters
authored andcommitted
Sync common files from infra repository
Synchronized from bootc-dev/infra@10decad. Signed-off-by: bootc-dev Bot <bot@bootc.dev>
1 parent 2c34df6 commit a4bda72

File tree

5 files changed

+119
-16
lines changed

5 files changed

+119
-16
lines changed

.bootc-dev-infra-commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b23aa64010d014befa5adc5bc54363b6fb60a3e4
1+
10decade10bbbb5d7dea158661b612eb743ebad7

.github/actions/bootc-ubuntu-setup/action.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,21 @@ runs:
6161
id: set_arch
6262
shell: bash
6363
run: echo "ARCH=$(arch)" >> $GITHUB_ENV
64-
# We often use Rust, so set up opinionated default caching
65-
- name: Setup Rust cache
66-
uses: Swatinem/rust-cache@v2
67-
with:
68-
cache-all-crates: true
69-
# Only generate caches on push to git main
70-
save-if: ${{ github.ref == 'refs/heads/main' }}
71-
# Suppress actually using the cache for builds running from
72-
# git main so that we avoid incremental compilation bugs
73-
lookup-only: ${{ github.ref == 'refs/heads/main' }}
7464
# Install libvirt stack if requested
7565
- name: Install libvirt and virtualization stack
7666
if: ${{ inputs.libvirt == 'true' }}
7767
shell: bash
78-
env:
79-
GH_TOKEN: ${{ github.token }}
8068
run: |
8169
set -xeuo pipefail
82-
export BCVK_VERSION=0.6.0
70+
export BCVK_VERSION=0.8.0
8371
/bin/time -f '%E %C' sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm virtiofsd libvirt-daemon-system
8472
# Something in the stack is overriding this, but we want session right now for bcvk
8573
echo LIBVIRT_DEFAULT_URI=qemu:///session >> $GITHUB_ENV
8674
td=$(mktemp -d)
8775
cd $td
88-
# Install bcvk from PR 159
89-
gh run download 19640807620 --name bcvk-binary --repo bootc-dev/bcvk
76+
# Install bcvk
9077
target=bcvk-$(arch)-unknown-linux-gnu
78+
/bin/time -f '%E %C' curl -LO https://github.com/bootc-dev/bcvk/releases/download/v${BCVK_VERSION}/${target}.tar.gz
9179
tar xzf ${target}.tar.gz
9280
sudo install -T ${target} /usr/bin/bcvk
9381
cd -
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Setup Rust'
2+
description: 'Install Rust toolchain with caching and nextest'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install Rust toolchain
7+
uses: dtolnay/rust-toolchain@stable
8+
- name: Install nextest
9+
uses: taiki-e/install-action@v2
10+
with:
11+
tool: nextest
12+
- name: Setup Rust cache
13+
uses: Swatinem/rust-cache@v2
14+
with:
15+
cache-all-crates: true
16+
# Only generate caches on push to git main
17+
save-if: ${{ github.ref == 'refs/heads/main' }}
18+
# Suppress actually using the cache for builds running from
19+
# git main so that we avoid incremental compilation bugs
20+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Upstream https://github.com/ossf/scorecard/blob/main/.github/workflows/scorecard-analysis.yml
2+
# Tweaked to not pin actions by SHA digest as I think that's overkill noisy security theater.
3+
name: OpenSSF Scorecard analysis
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions: read-all
10+
11+
jobs:
12+
analysis:
13+
name: Scorecard analysis
14+
runs-on: ubuntu-24.04
15+
permissions:
16+
# Needed for Code scanning upload
17+
security-events: write
18+
# Needed for GitHub OIDC token if publish_results is true
19+
id-token: write
20+
21+
steps:
22+
- name: "Checkout code"
23+
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
26+
27+
- name: "Run analysis"
28+
uses: ossf/scorecard-action@v2.4.3
29+
with:
30+
results_file: results.sarif
31+
results_format: sarif
32+
# Scorecard team runs a weekly scan of public GitHub repos,
33+
# see https://github.com/ossf/scorecard#public-data.
34+
# Setting `publish_results: true` helps us scale by leveraging your workflow to
35+
# extract the results instead of relying on our own infrastructure to run scans.
36+
# And it's free for you!
37+
publish_results: true
38+
39+
- name: "Upload artifact"
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: SARIF file
43+
path: results.sarif
44+
retention-days: 5
45+
46+
- name: "Upload to code-scanning"
47+
uses: github/codeql-action/upload-sarif@v4
48+
with:
49+
sarif_file: results.sarif
50+

.github/workflows/rebase.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Automatic Rebase
2+
on:
3+
pull_request:
4+
types: [labeled]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
rebase:
11+
name: Rebase
12+
if: github.event.label.name == 'needs-rebase'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Generate Actions Token
16+
id: token
17+
uses: actions/create-github-app-token@v2
18+
with:
19+
app-id: ${{ secrets.APP_ID }}
20+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
21+
owner: ${{ github.repository_owner }}
22+
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
with:
26+
token: ${{ steps.token.outputs.token }}
27+
fetch-depth: 0
28+
29+
- name: Automatic Rebase
30+
uses: peter-evans/rebase@v3
31+
with:
32+
token: ${{ steps.token.outputs.token }}
33+
34+
- name: Remove needs-rebase label
35+
if: always()
36+
uses: actions/github-script@v8
37+
with:
38+
github-token: ${{ steps.token.outputs.token }}
39+
script: |
40+
await github.rest.issues.removeLabel({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
issue_number: context.issue.number,
44+
name: 'needs-rebase'
45+
});

0 commit comments

Comments
 (0)