Skip to content

Commit e016a36

Browse files
committed
ci: Remove dead code, unused inputs and honor input refs
- Delete unused typos.toml (spell-check runs cspell, not typos). - Remove useless "Get revision SHA" steps and inline github.ref_name where the branch value is still needed (build-latest). - Remove the dead "Get image digest" and "Set short SHA" steps in build-latest. - Drop unused workflow inputs (runner, runner-arch-map, unused runner-archs, dead ref) and their call-site passes - Use the declared ref input into checkout (lint, unit_test, vm_test, kind_test) - Remove unused GIT_CLONE_PAT secret and no-op workflow_dispatch triggers that cannot run standalone (upload_s3, vm_test, kind_test) - Drop redundant host dependency install in kind_test (used only inside the node) Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
1 parent c70cdcd commit e016a36

12 files changed

Lines changed: 14 additions & 176 deletions

.github/linters/urunc-dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,4 @@ hyperlight
429429
Hyperlight
430430
Odysseas
431431
Kalaitsidis
432+
archs

.github/workflows/build-latest.yml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ name: 🍜 Build/publish urunc-deploy image
33
on:
44
workflow_call:
55
inputs:
6-
runner:
7-
type: string
8-
default: '["base", "dind", "2204"]'
96
runner-archs:
107
type: string
118
default: '["amd64", "aarch64"]'
129
dockerfiles:
1310
type: string
1411
default: '["Dockerfile"]'
15-
runner-arch-map:
16-
type: string
17-
default: '[{"amd64":"x86_64", "aarch64":"aarch64", "armv7l":"armv7l"}]'
1812
registry:
1913
type: string
2014
default: 'ghcr.io'
@@ -57,9 +51,6 @@ jobs:
5751
- name: Checkout the repo
5852
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5953

60-
- name: Set short SHA
61-
run: echo "SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
62-
6354
- name: Set up Docker Buildx
6455
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
6556

@@ -78,36 +69,6 @@ jobs:
7869
tags: |
7970
type=sha,prefix=${{ env.ARCH }}-
8071
81-
- name: Get revision SHA and branch (safe)
82-
id: get-rev
83-
env:
84-
EVENT_NAME: ${{ github.event_name }}
85-
IS_MERGED: ${{ github.event.pull_request.merged }}
86-
GITHUB_SHA: ${{ github.sha }}
87-
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
88-
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
89-
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
90-
REF_NAME: ${{ github.ref_name }}
91-
run: |
92-
if [ "$EVENT_NAME" == "pull_request" ]; then
93-
if [ "$IS_MERGED" == "true" ]; then
94-
sha="$GITHUB_SHA"
95-
branch="$PR_BASE_REF"
96-
echo "PR merged. SHA: ${sha}, Branch: ${branch}"
97-
else
98-
sha="$PR_HEAD_SHA"
99-
branch="$PR_HEAD_REF"
100-
echo "PR not yet merged. SHA: ${sha}, Branch: ${branch}"
101-
fi
102-
else
103-
sha="$GITHUB_SHA"
104-
branch="$REF_NAME"
105-
echo "$EVENT_NAME event. SHA: ${sha}, Branch: ${branch}"
106-
fi
107-
108-
echo "sha=${sha}" >> "$GITHUB_OUTPUT"
109-
echo "branch=${branch}" >> "$GITHUB_OUTPUT"
110-
11172
- name: Build and push urunc-deploy-${{ matrix.arch}}
11273
id: build-and-push
11374
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # master
@@ -118,15 +79,9 @@ jobs:
11879
push: true
11980
file: ${{ inputs.dockerfiles }}
12081
build-args: |
121-
BRANCH=${{ steps.get-rev.outputs.branch }}
82+
BRANCH=${{ github.ref_name }}
12283
REPO=${{ github.repository }}
12384
provenance: false
124-
125-
- name: Get image digest
126-
run: |
127-
echo "IMAGE_DIGEST=$(docker inspect \
128-
${{ env.REGISTRY }}/${{ github.repository }}/urunc-deploy:${{ env.ARCH }}-${{ env.SHA_SHORT }} | \
129-
jq -r '.[0].Id')" >> $GITHUB_ENV
13085

13186
- name: Install cosign
13287
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # main

.github/workflows/build-trigger.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
uses: ./.github/workflows/build-latest.yml
6161
secrets: inherit
6262
with:
63-
runner: '["base", "dind", "2204"]'
6463
runner-archs: '["amd64", "arm64"]'
6564
dockerfiles: 'deployment/urunc-deploy/Dockerfile'
6665
version-tag: ${{ needs.get-changed-files.outputs.version == 'true' }}

.github/workflows/build.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,6 @@ jobs:
5252
run: |
5353
go version
5454
55-
- name: Get revision SHA and branch (safe)
56-
id: get-rev
57-
env:
58-
EVENT_NAME: ${{ github.event_name }}
59-
IS_MERGED: ${{ github.event.pull_request.merged }}
60-
GITHUB_SHA: ${{ github.sha }}
61-
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
62-
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
63-
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
64-
REF_NAME: ${{ github.ref_name }}
65-
run: |
66-
if [ "$EVENT_NAME" == "pull_request" ]; then
67-
if [ "$IS_MERGED" == "true" ]; then
68-
sha="$GITHUB_SHA"
69-
branch="$PR_BASE_REF"
70-
echo "PR merged. SHA: ${sha}, Branch: ${branch}"
71-
else
72-
sha="$PR_HEAD_SHA"
73-
branch="$PR_HEAD_REF"
74-
echo "PR not yet merged. SHA: ${sha}, Branch: ${branch}"
75-
fi
76-
else
77-
sha="$GITHUB_SHA"
78-
branch="$REF_NAME"
79-
echo "$EVENT_NAME event. SHA: ${sha}, Branch: ${branch}"
80-
fi
81-
82-
echo "sha=${sha}" >> "$GITHUB_OUTPUT"
83-
echo "branch=${branch}" >> "$GITHUB_OUTPUT"
84-
8555
- name: Build urunc binaries
8656
id: build-urunc-binaries
8757
run: |

.github/workflows/ci_main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
name: Upload
2929
needs: build
3030
uses: ./.github/workflows/upload_s3.yml
31-
with:
32-
ref: ${{ github.sha }}
3331
secrets:
3432
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
3533
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/kind_test.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ on:
55
ref:
66
type: string
77
default: ''
8-
runner:
9-
type: string
10-
default: '["base", "dind", "2204"]'
11-
runner-archs:
12-
type: string
13-
default: '["amd64", "arm64"]'
14-
runner-arch-map:
15-
type: string
16-
default: '[{"amd64":"x86_64", "arm64":"aarch64", "arm":"armv7l"}]'
178
firecracker_version:
189
type: string
1910
required: true
@@ -23,10 +14,6 @@ on:
2314
runc_version:
2415
required: true
2516
type: string
26-
secrets:
27-
GIT_CLONE_PAT:
28-
required: false
29-
workflow_dispatch:
3017
permissions:
3118
contents: read
3219

@@ -50,11 +37,9 @@ jobs:
5037

5138
- name: Checkout repository
5239
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40+
with:
41+
ref: ${{ inputs.ref }}
5342

54-
- name: Install base dependencies
55-
run: |
56-
sudo apt-get update
57-
sudo apt-get install -y git wget build-essential libseccomp-dev pkg-config bc make
5843
- name: Install kind
5944
run: |
6045
ARCH=$(uname -m)

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3535
with:
36-
ref: ${{ github.event.pull_request.head.sha }}
36+
ref: ${{ inputs.ref }}
3737
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
3838
with:
3939
go-version: ${{ inputs.go_version }}

.github/workflows/pr-merge.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ jobs:
5151
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
5252
PR_BRANCH: ${{ github.event.pull_request.base.ref }}
5353
run: |
54-
PR_BRANCH=${{ github.event.pull_request.base.ref }}
55-
5654
# Create the pull request
5755
PR_URL=$(gh pr create \
5856
--head "$PR_BRANCH" \

.github/workflows/unit_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3939
with:
40-
ref: ${{ github.event.pull_request.head.sha }}
40+
ref: ${{ inputs.ref }}
4141

4242
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
4343
with:

.github/workflows/upload_s3.yml

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,12 @@ name: Upload to S3
22

33
on:
44
workflow_call:
5-
inputs:
6-
ref:
7-
required: true
8-
type: string
9-
default: ''
105
secrets:
116
AWS_ACCESS_KEY:
127
required: true
138
AWS_SECRET_ACCESS_KEY:
149
required: true
1510

16-
17-
workflow_dispatch:
18-
inputs:
19-
ref:
20-
required: true
21-
type: string
22-
default: ''
23-
2411
permissions:
2512
contents: read
2613

@@ -42,36 +29,6 @@ jobs:
4229
with:
4330
egress-policy: audit
4431

45-
- name: Get revision SHA and branch (safe)
46-
id: get-rev
47-
env:
48-
EVENT_NAME: ${{ github.event_name }}
49-
IS_MERGED: ${{ github.event.pull_request.merged }}
50-
GITHUB_SHA: ${{ github.sha }}
51-
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
52-
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
53-
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
54-
REF_NAME: ${{ github.ref_name }}
55-
run: |
56-
if [ "$EVENT_NAME" == "pull_request" ]; then
57-
if [ "$IS_MERGED" == "true" ]; then
58-
sha="$GITHUB_SHA"
59-
branch="$PR_BASE_REF"
60-
echo "PR merged. SHA: ${sha}, Branch: ${branch}"
61-
else
62-
sha="$PR_HEAD_SHA"
63-
branch="$PR_HEAD_REF"
64-
echo "PR not yet merged. SHA: ${sha}, Branch: ${branch}"
65-
fi
66-
else
67-
sha="$GITHUB_SHA"
68-
branch="$REF_NAME"
69-
echo "$EVENT_NAME event. SHA: ${sha}, Branch: ${branch}"
70-
fi
71-
72-
echo "sha=${sha}" >> "$GITHUB_ENV"
73-
echo "branch=${branch}" >> "$GITHUB_ENV"
74-
7532
- name: Download urunc artifact
7633
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
7734
with:
@@ -91,7 +48,7 @@ jobs:
9148
access-key: ${{ secrets.AWS_ACCESS_KEY }}
9249
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
9350
local-path: urunc_static_${{ matrix.arch }}
94-
remote-path: nbfc-assets/github/urunc/dist/${{ env.branch }}/${{ matrix.arch }}/
51+
remote-path: nbfc-assets/github/urunc/dist/${{ github.ref_name }}/${{ matrix.arch }}/
9552
policy: 1
9653

9754
- name: Upload containerd-shim-urunc-v2 to S3
@@ -101,5 +58,5 @@ jobs:
10158
access-key: ${{ secrets.AWS_ACCESS_KEY }}
10259
secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10360
local-path: containerd-shim-urunc-v2_static_${{ matrix.arch }}
104-
remote-path: nbfc-assets/github/urunc/dist/${{ env.branch }}/${{ matrix.arch }}/
61+
remote-path: nbfc-assets/github/urunc/dist/${{ github.ref_name }}/${{ matrix.arch }}/
10562
policy: 1

0 commit comments

Comments
 (0)