Extract a composite action to install Go
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
69dff411ad
commit
488b563610
16
.github/actions/install-go/action.yml
vendored
Normal file
16
.github/actions/install-go/action.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: "Setup Go"
|
||||
description: "Reusable action to install Go, so there is one place to bump Go versions"
|
||||
inputs:
|
||||
go-version:
|
||||
required: true
|
||||
default: "1.21.6"
|
||||
description: "Go version to install"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: "Setup Go"
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
cache: false # see actions/setup-go#368
|
60
.github/workflows/ci.yml
vendored
60
.github/workflows/ci.yml
vendored
@ -6,11 +6,6 @@ on:
|
||||
pull_request:
|
||||
branches: ['main', 'release/**']
|
||||
|
||||
env:
|
||||
# Go version we currently use to build containerd across all CI.
|
||||
# Note: don't forget to update `Binaries` step, as it contains the matrix of all supported Go versions.
|
||||
GO_VERSION: "1.21.6"
|
||||
|
||||
permissions: # added using https://github.com/step-security/secure-workflows
|
||||
contents: read
|
||||
|
||||
@ -31,12 +26,8 @@ jobs:
|
||||
os: [ubuntu-22.04, actuated-arm64-4cpu-16gb, macos-12, windows-2019]
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-go
|
||||
- uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.55.2
|
||||
@ -53,16 +44,13 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: src/github.com/containerd/containerd
|
||||
fetch-depth: 100
|
||||
|
||||
- uses: ./src/github.com/containerd/containerd/.github/actions/install-go
|
||||
|
||||
- uses: containerd/project-checks@v1.1.0
|
||||
with:
|
||||
working-directory: src/github.com/containerd/containerd
|
||||
@ -87,15 +75,12 @@ jobs:
|
||||
working-directory: src/github.com/containerd/containerd
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: src/github.com/containerd/containerd
|
||||
|
||||
- uses: ./src/github.com/containerd/containerd/.github/actions/install-go
|
||||
|
||||
- name: Set env
|
||||
shell: bash
|
||||
run: |
|
||||
@ -120,11 +105,8 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-go
|
||||
- run: go install github.com/cpuguy83/go-md2man/v2@v2.0.2
|
||||
- run: make man
|
||||
|
||||
@ -154,11 +136,8 @@ jobs:
|
||||
goarm: "7"
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-go
|
||||
- run: |
|
||||
set -e -x
|
||||
|
||||
@ -211,13 +190,8 @@ jobs:
|
||||
os: [ubuntu-22.04, actuated-arm64-4cpu-16gb, macos-12, windows-2019, windows-2022]
|
||||
go-version: ["1.20.13", "1.21.6"]
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: false # see actions/setup-go#368
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: ./.github/actions/install-go
|
||||
- name: Make
|
||||
run: |
|
||||
make build
|
||||
@ -245,15 +219,12 @@ jobs:
|
||||
working-directory: src/github.com/containerd/containerd
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: src/github.com/containerd/containerd
|
||||
|
||||
- uses: ./.github/actions/install-go
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: kubernetes-sigs/cri-tools
|
||||
@ -409,12 +380,8 @@ jobs:
|
||||
env:
|
||||
GOTEST: gotestsum --
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-go
|
||||
|
||||
- name: Install containerd dependencies
|
||||
env:
|
||||
@ -614,11 +581,8 @@ jobs:
|
||||
GOTEST: gotestsum --
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: false # see actions/setup-go#368
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/install-go
|
||||
- run: script/setup/install-gotestsum
|
||||
- run: script/setup/install-teststat
|
||||
- name: Tests
|
||||
|
Loading…
Reference in New Issue
Block a user