Skip to content

Commit

Permalink
Tests adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
  • Loading branch information
apostasie committed Oct 11, 2024
1 parent 7829682 commit 0953eba
Show file tree
Hide file tree
Showing 22 changed files with 287 additions and 367 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ghcr-image-build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Container Image Build
name: image

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
Expand All @@ -21,9 +21,8 @@ env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:
publish:

runs-on: ubuntu-24.04
permissions:
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: lint

on:
push:
branches:
- main
- 'release/**'
pull_request:

env:
GO_VERSION: 1.23.x

jobs:
go:
timeout-minutes: 5
name: "go | ${{ matrix.goos }} | ${{ matrix.gonext }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
include:
- os: ubuntu-24.04
goos: linux
- os: ubuntu-24.04
goos: freebsd
# FIXME: this is currently failing in a non-sensical way, so, running on linux instead...
# - os: windows-2022
- os: ubuntu-24.04
goos: windows
- os: ubuntu-24.04
goos: linux
# This allows the canary script to select any upcoming golang alpha/beta/RC
gonext: next
- os: ubuntu-24.04
goos: freebsd
gonext: next
- os: ubuntu-24.04
goos: windows
gonext: next
env:
GOOS: "${{ matrix.goos }}"
steps:
- uses: actions/checkout@v4.2.1
with:
fetch-depth: 1
- name: Set GO env
run: |
# If gonext is specified, get the latest available golang pre-release instead of the major version
if [ "$gonext" != "" ]; then
. ./hack/build-integration-canary.sh
canary::golang::latest
fi
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --verbose

other:
timeout-minutes: 5
name: yaml, shell, import order
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.1
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: yaml
run: make lint-yaml
- name: shell
run: make lint-shell
- name: go imports ordering
run: |
go install -v github.com/incu6us/goimports-reviser/v3@latest
make lint-imports
31 changes: 7 additions & 24 deletions .github/workflows/test-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,6 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
lint:
runs-on: "ubuntu-24.04"
timeout-minutes: 20
steps:
- uses: actions/checkout@v4.2.1
with:
fetch-depth: 1
- name: Set GO env
run: |
. ./hack/build-integration-canary.sh
canary::golang::latest
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6.1.1
with:
args: --verbose

linux:
runs-on: "ubuntu-24.04"
timeout-minutes: 40
Expand Down Expand Up @@ -66,10 +45,12 @@ jobs:
run: go test -v ./pkg/...
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh
- name: "Run integration tests (flaky)"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky

windows:
runs-on: windows-latest
timeout-minutes: 30
runs-on: windows-latest
defaults:
run:
shell: bash
Expand All @@ -95,6 +76,7 @@ jobs:
cache: true
check-latest: true
- run: go install ./cmd/nerdctl
- run: go install -v gotest.tools/gotestsum@v1
# This here is solely to get the cni install script, which has not been modified in 3+ years.
# There is little to no reason to update this to latest containerd
- uses: actions/checkout@v4.2.1
Expand All @@ -112,5 +94,6 @@ jobs:
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
run: powershell hack/configure-windows-ci.ps1
- name: "Run integration tests"
# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
run: go test -p 1 -v ./cmd/nerdctl/...
run: ./hack/test-integration.sh
- name: "Run integration tests (flaky)"
run: ./hack/test-integration.sh -test.only-flaky
5 changes: 2 additions & 3 deletions .github/workflows/test-kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ on:
paths-ignore:
- '**.md'

env:
ROOTFUL: true

jobs:
linux:
runs-on: "ubuntu-24.04"
timeout-minutes: 40
env:
ROOTFUL: true
steps:
- uses: actions/checkout@v4.2.1
with:
Expand Down
Loading

0 comments on commit 0953eba

Please sign in to comment.