diff --git a/.github/workflows/aci-tests.yml b/.github/workflows/aci-tests.yml index 9bb22fe7..6700ccfd 100644 --- a/.github/workflows/aci-tests.yml +++ b/.github/workflows/aci-tests.yml @@ -29,24 +29,20 @@ jobs: needs: check-optional-tests if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true' steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} + cache: true - name: Setup docker CLI run: | curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} - - name: Build for ACI e2e tests run: make -f builder.Makefile cli diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e41b32c0..3de3d3a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,14 @@ jobs: name: Lint runs-on: ubuntu-latest steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 + cache: true - name: Validate go-mod is up-to-date and license headers run: make validate @@ -38,18 +39,14 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} + cache: true # Ensure we don't discover cross platform build issues at release time. # Time used to build linux here is gained back in the build for local E2E step @@ -60,10 +57,14 @@ jobs: name: Build runs-on: ubuntu-latest steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} + cache: true - name: Set up gosum run: | @@ -74,14 +75,6 @@ jobs: curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} - - name: Test env: BUILD_TAGS: kube diff --git a/.github/workflows/cli-release.yaml b/.github/workflows/cli-release.yaml index c5a6d1c0..e51a514f 100644 --- a/.github/workflows/cli-release.yaml +++ b/.github/workflows/cli-release.yaml @@ -18,26 +18,20 @@ jobs: release: runs-on: ubuntu-latest steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} + cache: true - name: Setup docker CLI run: | curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Build run: make GIT_TAG=${{ github.event.inputs.tag }} -f builder.Makefile cross diff --git a/.github/workflows/ecs-tests.yml b/.github/workflows/ecs-tests.yml index 42a23349..fddd5a3e 100644 --- a/.github/workflows/ecs-tests.yml +++ b/.github/workflows/ecs-tests.yml @@ -29,24 +29,20 @@ jobs: needs: check-optional-tests if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-ecs == 'true' steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} + cache: true - name: Setup docker CLI run: | curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} - - name: Build for ECS e2e tests run: make -f builder.Makefile cli diff --git a/.github/workflows/kube-tests.yml b/.github/workflows/kube-tests.yml index 141f5283..21bdd2fa 100644 --- a/.github/workflows/kube-tests.yml +++ b/.github/workflows/kube-tests.yml @@ -29,10 +29,14 @@ jobs: needs: check-optional-tests if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-kube == 'true' steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} + cache: true - name: Setup docker CLI run: | @@ -45,14 +49,6 @@ jobs: curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-amd64 && chmod +x ./kind && sudo mv ./kind /usr/bin/ && kind version curl -LO "https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl" && sudo mv kubectl /usr/bin/ && kubectl version --client - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} - - name: Build for Kube e2e tests env: BUILD_TAGS: kube diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index db520379..ea0556dc 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the latest code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 # otherwise, you will fail to push refs to dest repo diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 7326cce3..2a98bd93 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -31,10 +31,14 @@ jobs: needs: check-optional-tests if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true' steps: + - name: Checkout code into the Go module directory + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} + cache: true - name: Setup docker CLI run: | @@ -43,14 +47,6 @@ jobs: mv -Force ./docker.exe "C:\Program Files\Docker\" docker version - - name: Checkout code into the Go module directory - uses: actions/checkout@v2 - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} - - name: Test run: make -f builder.Makefile test