Skip to content

Commit 05c3ece

Browse files
committed
Cleanup canary
Signed-off-by: apostasie <[email protected]>
1 parent 5957cee commit 05c3ece

File tree

9 files changed

+149
-171
lines changed

9 files changed

+149
-171
lines changed

.github/actions/dev-tools/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Dev-tools install"
2+
3+
description: "This action installs dev-tools, with caching."
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Environment setup
9+
shell: bash
10+
run: |
11+
echo "GO_VERSION=$(go version) >> "$GITHUB_ENV"
12+
echo "UNAME=$(uname)" >> "$GITHB_ENV"
13+
- name: Enable cache
14+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
15+
id: cache
16+
with:
17+
path: ~/go/bin
18+
key: dev-tools-${{ env.UNAME }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
19+
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
20+
name: Install dev tools
21+
shell: bash
22+
continue-on-error: false
23+
run: make install-dev-tools

.github/actions/install-go/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Go install"
2+
3+
description: "This action installs go, with caching.
4+
By default, the latest stable release is used.
5+
You can also pass an explicit version:
6+
- `1.23` will install the latest stable patch release for that branch
7+
- `1.22.2` will install that specific version
8+
- `canary` will install the latest alpha/beta/RC"
9+
10+
inputs:
11+
version:
12+
default: ""
13+
description: ""
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Environment setup
19+
shell: bash
20+
run: |
21+
export GO_VERSION=${{ inputs.version }}
22+
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
23+
echo "PATH=/opt/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
24+
echo "UNAME=$(uname)" >> "$GITHB_ENV"
25+
- name: Enable cache
26+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
27+
id: cache
28+
with:
29+
path: /opt/go
30+
key: golang-${{ env.UNAME }}-${{ env.GO_VERSION }}
31+
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
32+
name: Install go
33+
shell: bash
34+
continue-on-error: false
35+
run: GO_INSTALL_DESTINATION=/opt make install-go

.github/workflows/lint.yml

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,22 @@ env:
1111
GO_VERSION: 1.24
1212
GOTOOLCHAIN: local
1313
GO_INSTALL_DESTINATION: /opt
14+
GOOS: linux
1415

1516
jobs:
1617
go_current:
1718
timeout-minutes: 5
1819
name: "go stable"
1920
runs-on: ubuntu-24.04
2021
steps:
21-
# First, setup: clone, install go (with cache), install dev tools (with cache)
22+
# Clone
2223
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23-
with:
24-
fetch-depth: 100
25-
- name: Environment setup
26-
run: |
27-
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
28-
echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
29-
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
30-
id: cache-go
31-
with:
32-
path: /opt/go
33-
key: golang-${{ env.GO_VERSION }}
34-
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
35-
id: cache-go-dev
36-
with:
37-
path: ~/go/bin
38-
key: golang-dev-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
39-
- if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
40-
name: Install go
41-
continue-on-error: false
42-
run: make install-go
43-
- if: ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
44-
name: Install dev tools
45-
continue-on-error: false
46-
run: make install-dev-tools
24+
# Install go
25+
- name: "Install go"
26+
uses: ./.github/actions/install-go
27+
# Install dev-tools
28+
- name: "Install dev-tools"
29+
uses: ./.github/actions/dev-tools
4730

4831
- name: imports
4932
run: make lint-imports
@@ -63,29 +46,14 @@ jobs:
6346
env:
6447
GO_VERSION: canary
6548
steps:
49+
# Clone
6650
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67-
with:
68-
fetch-depth: 1
69-
- name: Environment setup
70-
run: |
71-
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
72-
echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
73-
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
74-
id: cache-go
75-
with:
76-
path: /opt/go
77-
key: golang-${{ env.GO_VERSION }}
78-
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
79-
id: cache-go-dev
80-
with:
81-
path: ~/go/bin
82-
key: golang-dev-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
83-
- if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
84-
name: Install go
85-
run: make install-go
86-
- if: ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
87-
name: Install dev tools
88-
run: make install-dev-tools
51+
# Install go
52+
- name: "Install go"
53+
uses: ./.github/actions/install-go
54+
# Install dev-tools
55+
- name: "Install dev-tools"
56+
uses: ./.github/actions/dev-tools
8957

9058
- name: imports
9159
run: make lint-imports
@@ -100,8 +68,6 @@ jobs:
10068
runs-on: ubuntu-24.04
10169
steps:
10270
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103-
with:
104-
fetch-depth: 1
10571
- name: make lint-yaml
10672
run: make lint-yaml
10773
- name: make lint-shell

.github/workflows/test-canary.yml

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,25 @@ on:
1111
- '**.md'
1212

1313
env:
14-
UBUNTU_VERSION: "24.04"
14+
GO_VERSION: canary
15+
GOTOOLCHAIN: local
16+
GO_INSTALL_DESTINATION: /opt
17+
GOOS: linux
1518
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1619

1720
jobs:
1821
linux:
19-
runs-on: "ubuntu-24.04"
22+
runs-on: ubuntu-24.04
2023
timeout-minutes: 40
2124
steps:
2225
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23-
with:
24-
fetch-depth: 1
25-
- name: "Prepare integration test environment"
26+
- name: "Setup environment"
2627
run: |
28+
# Get latest canary go version
29+
export GO_VERSION=$(make install-go-resolve-version)
30+
# Build integration image with updated dependencies
2731
. ./hack/build-integration-canary.sh
28-
canary::build::integration
32+
LOG_LEVEL=info canary::build::integration
2933
- name: "Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
3034
run: |
3135
sudo systemctl disable --now snapd.service snapd.socket
@@ -41,6 +45,7 @@ jobs:
4145
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
4246
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
4347
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
48+
4449
- name: "Run unit tests"
4550
run: go test -v ./pkg/...
4651
- name: "Run integration tests"
@@ -50,48 +55,56 @@ jobs:
5055

5156
windows:
5257
timeout-minutes: 40
53-
runs-on: windows-latest
58+
runs-on: windows-2022
59+
env:
60+
GOOS: windows
5461
defaults:
5562
run:
5663
shell: bash
5764
steps:
58-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65+
- name: "Clone"
66+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67+
- name: "Setup go environment"
68+
run: |
69+
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
70+
echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
71+
- name: "Cache go"
72+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
73+
id: cache-go
74+
with:
75+
path: /opt/go
76+
key: golang-${{ env.GOOS }}-${{ env.GO_VERSION }}
77+
- if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
78+
name: "Setup go"
79+
continue-on-error: false
80+
run: make install-go
81+
- name: "Cache dev-tools"
82+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
83+
id: cache-go-dev
5984
with:
60-
fetch-depth: 1
61-
- name: Set GO env
85+
path: ~/go/bin
86+
key: golang-dev-${{ env.GOOS }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
87+
- if: ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
88+
name: "Setup dev tools"
89+
continue-on-error: false
90+
run: make install-dev-tools
91+
- name: "Setup CNI & containerd"
6292
run: |
63-
# Get latest containerd
93+
# CNI install script has not been modified in 3+ years.
94+
# There is little to no reason to update this to latest containerd
95+
curl -fsSLO https://raw.githubusercontent.com/containerd/containerd/refs/tags/v1.7.25/script/setup/install-cni-windows
96+
GOPATH=$(go env GOPATH) ./install-cni-windows
97+
# Setup nerdctl
98+
go install ./cmd/nerdctl
99+
# Get latest tagged containerd
64100
args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
65101
[ "${GITHUB_TOKEN:-}" == "" ] && {
66-
>&2 printf "GITHUB_TOKEN is not set - you might face rate limitations with the Github API\n"
102+
echo "GITHUB_TOKEN is not set - you might face rate limitations with the Github API"
67103
} || args+=(-H "Authorization: Bearer $GITHUB_TOKEN")
68104
ctd_v="$("${args[@]}" https://api.github.com/repos/containerd/containerd/tags | jq -rc .[0].name)"
69-
echo "CONTAINERD_VERSION=${ctd_v:1}" >> "$GITHUB_ENV"
70-
71-
. ./hack/build-integration-canary.sh
72-
canary::golang::latest
73-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
74-
with:
75-
go-version: ${{ env.GO_VERSION }}
76-
check-latest: true
77-
- run: go install ./cmd/nerdctl
78-
- run: make install-dev-tools
79-
# This here is solely to get the cni install script, which has not been modified in 3+ years.
80-
# There is little to no reason to update this to latest containerd
81-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82-
with:
83-
repository: containerd/containerd
84-
ref: "v1.7.25"
85-
path: containerd
86-
fetch-depth: 1
87-
- name: "Set up CNI"
88-
working-directory: containerd
89-
run: GOPATH=$(go env GOPATH) script/setup/install-cni-windows
90-
# Windows setup script can only use released versions
91-
- name: "Set up containerd"
92-
env:
93-
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
94-
run: powershell hack/configure-windows-ci.ps1
105+
ctrdVersion="${ctd_v:1}" powershell hack/configure-windows-ci.ps1
106+
- name: "Run unit tests"
107+
run: go test -v ./pkg/...
95108
- name: "Run integration tests"
96109
run: ./hack/test-integration.sh -test.only-flaky=false
97110
- name: "Run integration tests (flaky)"

.github/workflows/test-kube.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ on:
1212

1313
jobs:
1414
linux:
15-
runs-on: "ubuntu-24.04"
15+
runs-on: ubuntu-24.04
1616
timeout-minutes: 40
1717
env:
1818
ROOTFUL: true
1919
steps:
2020
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21-
with:
22-
fetch-depth: 1
2321
- name: "Run Kubernetes integration tests"
2422
# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
2523
run: |

.github/workflows/test.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ jobs:
3939
ARCH: "${{ matrix.arch }}"
4040
steps:
4141
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42-
with:
43-
fetch-depth: 1
4442
- name: "Expose GitHub Runtime variables for gha"
4543
uses: crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
4644
- name: "Build dependencies for the integration test environment image"
@@ -72,8 +70,6 @@ jobs:
7270
goos: linux
7371
steps:
7472
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
75-
with:
76-
fetch-depth: 1
7773
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
7874
with:
7975
go-version: ${{ env.GO_VERSION }}
@@ -119,8 +115,6 @@ jobs:
119115
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
120116
steps:
121117
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
122-
with:
123-
fetch-depth: 1
124118
- name: "Expose GitHub Runtime variables for gha"
125119
uses: crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
126120
- name: "Prepare integration test environment"
@@ -168,8 +162,6 @@ jobs:
168162
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
169163
steps:
170164
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
171-
with:
172-
fetch-depth: 1
173165
- name: Enable ipv4 and ipv6 forwarding
174166
run: |
175167
sudo sysctl -w net.ipv6.conf.all.forwarding=1
@@ -267,8 +259,6 @@ jobs:
267259
EOT
268260
sudo systemctl restart apparmor.service
269261
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
270-
with:
271-
fetch-depth: 1
272262
- name: "Register QEMU (tonistiigi/binfmt)"
273263
run: |
274264
# `--install all` will only install emulation for architectures that cannot be natively executed
@@ -310,8 +300,6 @@ jobs:
310300
go-version: ["1.23.x", "1.24.x"]
311301
steps:
312302
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
313-
with:
314-
fetch-depth: 1
315303
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
316304
with:
317305
go-version: ${{ matrix.go-version }}
@@ -325,8 +313,6 @@ jobs:
325313
runs-on: ubuntu-24.04
326314
steps:
327315
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
328-
with:
329-
fetch-depth: 1
330316
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
331317
with:
332318
go-version: ${{ env.GO_VERSION }}
@@ -361,8 +347,6 @@ jobs:
361347
shell: bash
362348
steps:
363349
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
364-
with:
365-
fetch-depth: 1
366350
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
367351
with:
368352
go-version: ${{ env.GO_VERSION }}
@@ -394,8 +378,6 @@ jobs:
394378
runs-on: ubuntu-24.04
395379
steps:
396380
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
397-
with:
398-
fetch-depth: 1
399381
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
400382
with:
401383
path: /root/.vagrant.d

0 commit comments

Comments
 (0)