forked from argoproj/argo-rollouts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
197 changed files
with
14,814 additions
and
3,158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,18 @@ name: Docker | |
on: | ||
push: | ||
branches: | ||
# - master # commented due to Codefresh convention | ||
- master | ||
- release-* | ||
|
||
# Run tests for any PRs. | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
set-vars: | ||
permissions: | ||
|
@@ -20,98 +26,68 @@ jobs: | |
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Docker meta (controller) | ||
id: controller-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
quay.io/codefresh/argo-rollouts | ||
# ghcr.io/codefresh-io/argo-rollouts | ||
quay.io/argoproj/argo-rollouts | ||
tags: | | ||
type=ref,event=branch | ||
# commented due to Codefresh convention | ||
# flavor: | | ||
# latest=${{ github.ref == 'refs/heads/master' }} | ||
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master'}} | ||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} | ||
- name: Docker meta (plugin) | ||
id: plugin-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
quay.io/codefresh/kubectl-argo-rollouts | ||
# ghcr.io/codefresh-io/kubectl-argo-rollouts | ||
quay.io/argoproj/kubectl-argo-rollouts | ||
tags: | | ||
type=ref,event=branch | ||
# commented due to Codefresh convention | ||
# flavor: | | ||
# latest=${{ github.ref == 'refs/heads/master' }} | ||
|
||
# - name: Login to GitHub Container Registry | ||
# if: github.event_name != 'pull_request' | ||
# uses: docker/login-action@v1 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.repository_owner }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Quay.io | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | ||
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master'}} | ||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} | ||
# avoid building linux/arm64 for PRs since it takes so long | ||
- name: Set Platform Matrix | ||
id: platform-matrix | ||
run: | | ||
PLATFORM_MATRIX=linux/amd64 | ||
if [ ${{ github.event_name != 'pull_request' }} = true ]; then | ||
if [[ "${{ github.event_name }}" == "push" || "${{ contains(github.event.pull_request.labels.*.name, 'test-arm-image') }}" == "true" ]] | ||
then | ||
PLATFORM_MATRIX=$PLATFORM_MATRIX,linux/arm64 | ||
fi | ||
echo "platform-matrix=$PLATFORM_MATRIX" >> $GITHUB_OUTPUT | ||
- name: Build and push (controller-image) | ||
uses: docker/build-push-action@v3 | ||
with: | ||
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.controller-meta.outputs.tags }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: Build and push (plugin-image) | ||
uses: docker/build-push-action@v3 | ||
with: | ||
target: kubectl-argo-rollouts | ||
platforms: ${{ steps.platform-matrix.outputs.platform-matrix }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.plugin-meta.outputs.tags }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
build-and-push-controller-image: | ||
needs: [set-vars] | ||
permissions: | ||
contents: read | ||
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags | ||
id-token: write # for creating OIDC tokens for signing. | ||
uses: ./.github/workflows/image-reuse.yaml | ||
with: | ||
quay_image_name: ${{ needs.set-vars.outputs.controller-meta-tags }} | ||
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations) | ||
go-version: '1.20' | ||
platforms: ${{ needs.set-vars.outputs.platforms }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
secrets: | ||
quay_username: ${{ secrets.QUAY_USERNAME }} | ||
quay_password: ${{ secrets.QUAY_ROBOT_TOKEN }} | ||
|
||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
build-and-push-plugin-image: | ||
needs: [set-vars] | ||
permissions: | ||
contents: read | ||
packages: write # for pushing packages to GHCR, which is used by cd.apps.argoproj.io to avoid polluting Quay with tags | ||
id-token: write # for creating OIDC tokens for signing. | ||
uses: ./.github/workflows/image-reuse.yaml | ||
with: | ||
quay_image_name: ${{ needs.set-vars.outputs.plugin-meta-tags }} | ||
# Note: cannot use env variables to set go-version (https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations) | ||
go-version: '1.20' | ||
platforms: ${{ needs.set-vars.outputs.platforms }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
target: kubectl-argo-rollouts | ||
secrets: | ||
quay_username: ${{ secrets.QUAY_USERNAME }} | ||
quay_password: ${{ secrets.QUAY_ROBOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,9 +46,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v4.1.0 | ||
with: | ||
go-version: 1.19 | ||
go-version: '1.20' | ||
- uses: actions/[email protected] | ||
- name: Setup k3s | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ on: | |
- "master" | ||
env: | ||
# Golang version to use across CI steps | ||
GOLANG_VERSION: '1.19' | ||
GOLANG_VERSION: '1.20' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -35,22 +35,22 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v4.1.0 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Run golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.49.0 | ||
version: v1.53.3 | ||
args: --timeout 6m | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v4.1.0 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
id: go | ||
|
@@ -89,7 +89,7 @@ jobs: | |
path: coverage.out | ||
|
||
- name: Upload code coverage information to codecov.io | ||
uses: codecov/[email protected].1 | ||
uses: codecov/[email protected].4 | ||
with: | ||
file: coverage.out | ||
|
||
|
@@ -102,7 +102,7 @@ jobs: | |
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Setup Golang | ||
uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v4.1.0 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
# k8s codegen generates files into GOPATH location instead of the GitHub git checkout location | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.