Merge pull request #9786 from mxpv/ci
Extract setup-go step into composite action
This commit is contained in:
commit
b3f1c15b6a
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
|
6
.github/workflows/build-test-images.yml
vendored
6
.github/workflows/build-test-images.yml
vendored
@ -41,14 +41,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: "1.21.6"
|
|
||||||
|
|
||||||
- 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: |
|
||||||
|
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: ./src/github.com/containerd/containerd/.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
|
||||||
|
4
.github/workflows/codeql.yml
vendored
4
.github/workflows/codeql.yml
vendored
@ -32,9 +32,7 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: ./.github/actions/install-go
|
||||||
with:
|
|
||||||
go-version: 1.21.6
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
|
4
.github/workflows/fuzz.yml
vendored
4
.github/workflows/fuzz.yml
vendored
@ -40,8 +40,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: 1.21.x
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ./.github/actions/install-go
|
||||||
- run: script/go-test-fuzz.sh
|
- run: script/go-test-fuzz.sh
|
||||||
|
6
.github/workflows/images.yml
vendored
6
.github/workflows/images.yml
vendored
@ -26,14 +26,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: "1.21.6"
|
|
||||||
|
|
||||||
- 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: |
|
||||||
|
15
.github/workflows/nightly.yml
vendored
15
.github/workflows/nightly.yml
vendored
@ -6,9 +6,6 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- ".github/workflows/nightly.yml"
|
- ".github/workflows/nightly.yml"
|
||||||
|
|
||||||
env:
|
|
||||||
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
|
||||||
|
|
||||||
@ -23,14 +20,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 }}
|
|
||||||
|
|
||||||
- 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: |
|
||||||
@ -143,14 +138,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 }}
|
|
||||||
|
|
||||||
- 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: |
|
||||||
|
Loading…
Reference in New Issue
Block a user