mirror of https://github.com/knative/func.git
chore: Add go setup as composite action (#2031)
This commit is contained in:
parent
87e9fb3cb9
commit
4deb1ff219
|
@ -0,0 +1,9 @@
|
|||
name: "Golang setup"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 1.21.x
|
||||
check-latest: true
|
|
@ -7,7 +7,6 @@ jobs:
|
|||
name: Build
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
|
@ -23,9 +22,7 @@ jobs:
|
|||
echo "/usr/local/bin" >> $GITHUB_PATH
|
||||
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Build
|
||||
run: make build
|
||||
|
||||
|
|
|
@ -7,14 +7,11 @@ jobs:
|
|||
name: Check Source
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Check
|
||||
run: make check
|
||||
|
||||
|
|
|
@ -9,9 +9,7 @@ jobs:
|
|||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Lint
|
||||
run: make check && make check-templates
|
||||
- name: Check that 'func.yaml schema' is up-to-date
|
||||
|
@ -22,16 +20,13 @@ jobs:
|
|||
test-unit:
|
||||
strategy:
|
||||
matrix:
|
||||
go: [ 1.20.x ]
|
||||
java: [ 17 ]
|
||||
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- run: git config --global core.autocrlf false
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
|
@ -48,9 +43,7 @@ jobs:
|
|||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
- name: Allocate Cluster
|
||||
|
@ -67,14 +60,11 @@ jobs:
|
|||
e2e-test:
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
- name: Allocate Cluster
|
||||
|
@ -91,14 +81,11 @@ jobs:
|
|||
e2e-on-cluster-test:
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: imjasonh/setup-ko@v0.6
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
|
@ -124,9 +111,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
- uses: ./.github/composite/go-setup
|
||||
# Standard build tasks
|
||||
- name: Build
|
||||
run: make cross-platform
|
||||
|
@ -165,8 +150,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: imjasonh/setup-ko@v0.6
|
||||
- run: ko build --platform=linux/ppc64le,linux/s390x,linux/amd64,linux/arm64 -B ./cmd/func
|
||||
|
|
|
@ -7,13 +7,10 @@ jobs:
|
|||
name: Check Schema
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Check that 'func.yaml schema' is up-to-date
|
||||
run: make schema-check
|
||||
|
|
|
@ -8,15 +8,12 @@ jobs:
|
|||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
func_builder: ["pack", "s2i"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: imjasonh/setup-ko@v0.6
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
|
|
|
@ -7,14 +7,11 @@ jobs:
|
|||
name: On Cluster Test
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: imjasonh/setup-ko@v0.6
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
|
|
|
@ -16,9 +16,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
- name: Allocate Cluster
|
||||
|
|
|
@ -7,14 +7,11 @@ jobs:
|
|||
name: E2E Test
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
- name: Allocate Cluster
|
||||
|
|
|
@ -7,18 +7,15 @@ jobs:
|
|||
name: Func Embedded FS Test
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Check embedded templates content
|
||||
run: |
|
||||
if ! go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem; then
|
||||
echo "Content of templates directory and embedded FS (zz_filesystem_generated.go) doesn't match!"
|
||||
echo "Consult https://github.com/knative/func/blob/main/docs/CONTRIBUTING.md#templates ."
|
||||
echo "Consult https:.github.com/knative/func/blob/main/docs/CONTRIBUTING.md#templates ."
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -7,14 +7,11 @@ jobs:
|
|||
name: Integration Test
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: imjasonh/setup-ko@v0.6
|
||||
- name: Install Binaries
|
||||
run: ./hack/binaries.sh
|
||||
|
|
|
@ -7,17 +7,14 @@ jobs:
|
|||
name: Podman Test
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
os: ["ubuntu-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Install Podman
|
||||
run: |
|
||||
# TODO uncomment following once https://github.com/containers/podman/pull/16781 is in the kubic repository
|
||||
# TODO uncomment following once https:.github.com/containers/podman/pull/16781 is in the kubic repository
|
||||
#. /etc/os-release
|
||||
#sudo mkdir -p /etc/apt/keyrings
|
||||
#curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_${VERSION_ID}/Release.key \
|
||||
|
|
|
@ -7,7 +7,6 @@ jobs:
|
|||
name: Unit Test
|
||||
strategy:
|
||||
matrix:
|
||||
go: [1.20.x]
|
||||
java: [17]
|
||||
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
@ -25,9 +24,7 @@ jobs:
|
|||
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
|
||||
- run: git config --global core.autocrlf false
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- uses: ./.github/composite/go-setup
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
|
|
|
@ -12,9 +12,7 @@ jobs:
|
|||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20.x"
|
||||
- uses: ./.github/composite/go-setup
|
||||
- name: Build and Push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
|
Loading…
Reference in New Issue