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:
|
pull_request:
|
||||||
branches: ['main', 'release/**']
|
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
|
permissions: # added using https://github.com/step-security/secure-workflows
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
@ -31,12 +26,8 @@ jobs:
|
|||||||
os: [ubuntu-22.04, actuated-arm64-4cpu-16gb, macos-12, windows-2019]
|
os: [ubuntu-22.04, actuated-arm64-4cpu-16gb, macos-12, windows-2019]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
- uses: golangci/golangci-lint-action@v3
|
- uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
version: v1.55.2
|
version: v1.55.2
|
||||||
@ -53,16 +44,13 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: src/github.com/containerd/containerd
|
path: src/github.com/containerd/containerd
|
||||||
fetch-depth: 100
|
fetch-depth: 100
|
||||||
|
|
||||||
|
- uses: ./src/github.com/containerd/containerd/.github/actions/install-go
|
||||||
|
|
||||||
- uses: containerd/project-checks@v1.1.0
|
- uses: containerd/project-checks@v1.1.0
|
||||||
with:
|
with:
|
||||||
working-directory: src/github.com/containerd/containerd
|
working-directory: src/github.com/containerd/containerd
|
||||||
@ -87,15 +75,12 @@ jobs:
|
|||||||
working-directory: src/github.com/containerd/containerd
|
working-directory: src/github.com/containerd/containerd
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: src/github.com/containerd/containerd
|
path: src/github.com/containerd/containerd
|
||||||
|
|
||||||
|
- uses: ./src/github.com/containerd/containerd/.github/actions/install-go
|
||||||
|
|
||||||
- name: Set env
|
- name: Set env
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@ -120,11 +105,8 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
- run: go install github.com/cpuguy83/go-md2man/v2@v2.0.2
|
- run: go install github.com/cpuguy83/go-md2man/v2@v2.0.2
|
||||||
- run: make man
|
- run: make man
|
||||||
|
|
||||||
@ -154,11 +136,8 @@ jobs:
|
|||||||
goarm: "7"
|
goarm: "7"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
- run: |
|
- run: |
|
||||||
set -e -x
|
set -e -x
|
||||||
|
|
||||||
@ -211,13 +190,8 @@ jobs:
|
|||||||
os: [ubuntu-22.04, actuated-arm64-4cpu-16gb, macos-12, windows-2019, windows-2022]
|
os: [ubuntu-22.04, actuated-arm64-4cpu-16gb, macos-12, windows-2019, windows-2022]
|
||||||
go-version: ["1.20.13", "1.21.6"]
|
go-version: ["1.20.13", "1.21.6"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ matrix.go-version }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
- name: Make
|
- name: Make
|
||||||
run: |
|
run: |
|
||||||
make build
|
make build
|
||||||
@ -245,15 +219,12 @@ jobs:
|
|||||||
working-directory: src/github.com/containerd/containerd
|
working-directory: src/github.com/containerd/containerd
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: src/github.com/containerd/containerd
|
path: src/github.com/containerd/containerd
|
||||||
|
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: kubernetes-sigs/cri-tools
|
repository: kubernetes-sigs/cri-tools
|
||||||
@ -409,12 +380,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GOTEST: gotestsum --
|
GOTEST: gotestsum --
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
|
|
||||||
- name: Install containerd dependencies
|
- name: Install containerd dependencies
|
||||||
env:
|
env:
|
||||||
@ -614,11 +581,8 @@ jobs:
|
|||||||
GOTEST: gotestsum --
|
GOTEST: gotestsum --
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: ${{ env.GO_VERSION }}
|
|
||||||
cache: false # see actions/setup-go#368
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
- run: script/setup/install-gotestsum
|
- run: script/setup/install-gotestsum
|
||||||
- run: script/setup/install-teststat
|
- run: script/setup/install-teststat
|
||||||
- name: Tests
|
- name: Tests
|
||||||
|
Loading…
Reference in New Issue
Block a user