Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel previous runs, bump CI deps, migrate set-output #1269

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ jobs:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
version: latest
Expand Down Expand Up @@ -70,16 +70,16 @@ jobs:
- discord
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
version: latest
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
Expand Down Expand Up @@ -129,12 +129,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
--set image.tag="${IMAGE_TAG}" \

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
version: latest
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/chart-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:
# The branches below must be a subset of the branches above
branches: [ "main" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }} # scope to for the current workflow
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} # cancel only PR related jobs

jobs:
chart-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
48 changes: 37 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ env:
HELM_VERSION: v3.9.0
GOLANGCI_LINT_VERSION: v1.54.2
GOLANGCI_LINT_TIMEOUT: 10m

concurrency:
group: ${{ github.workflow }}-${{ github.ref }} # scope to for the current workflow
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} # cancel only PR related jobs

jobs:
lint-go:
if: ${{ !contains(github.event.commits[0].message, '[skip-ci]') }}
runs-on: ubuntu-latest
name: Lint Go code
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
- name: Verify Go modules
run: go mod verify
if: always()
Expand All @@ -40,16 +40,42 @@ jobs:
else
echo '✔ No issues detected. Have a nice day :-)'
fi
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
# When the files to be extracted are already present,
# tar extraction in Golangci Lint fails with the "File exists"
# errors. These files appear to be present because of
# cache in setup-go, on disabling the cache we are no more seeing
# such error. Cache is to be enabled once the fix is available for
# this issue:
# https://github.com/golangci/golangci-lint-action/issues/807
cache: false

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}


test:
if: ${{ !contains(github.event.commits[0].message, '[skip-ci]') }}
runs-on: ubuntu-latest
name: Run tests
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
Expand All @@ -65,9 +91,9 @@ jobs:
name: Build app
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
# Runs at 09:00 UTC on Wed.
- cron: '0 9 * * 3'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }} # scope to for the current workflow
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} # cancel only PR related jobs

jobs:
analyze:
name: Analyze
Expand All @@ -26,10 +30,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cut-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
ref: ${{ steps.extract.outputs.ref }}
base-version: ${{ steps.extract.outputs.base-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
Expand All @@ -43,8 +43,8 @@ jobs:
echo "release-${BASE_VERSION} is found, now REF=release-${BASE_VERSION}"
REF=$(echo "release-${BASE_VERSION}")
fi
echo ::set-output name=ref::$REF
echo ::set-output name=base-version::$BASE_VERSION
echo "ref=$REF" >> $GITHUB_OUTPUT
echo "base-version=$BASE_VERSION" >> $GITHUB_OUTPUT
else
# Fail entire job if it is not a valid format
echo "${{ inputs.version }} is not a valid version format. Use something like 'v0.14.0'"
Expand All @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-22.04
needs: [workflow-metadata]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ needs.workflow-metadata.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}
Expand Down Expand Up @@ -96,4 +96,4 @@ jobs:
if: ${{ contains(needs.workflow-metadata.outputs.ref, env.main-branch ) }}
run: |
git checkout -b release-${{ needs.workflow-metadata.outputs.base-version }}
git push origin release-${{ needs.workflow-metadata.outputs.base-version }}
git push origin release-${{ needs.workflow-metadata.outputs.base-version }}
4 changes: 2 additions & 2 deletions .github/workflows/finalize-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: extract
run: |
BASE_VERSION=$(echo "${{ inputs.version }}" | cut -c2- | awk 'BEGIN{FS=OFS="."}NF--')
echo ::set-output name=base-version::$BASE_VERSION
echo "base-version=$BASE_VERSION" >> $GITHUB_OUTPUT

process-chart:
needs: [extract-metadata]
Expand All @@ -32,4 +32,4 @@ jobs:
release-branch: release-${{ needs.extract-metadata.outputs.base-version }}
next-version: ${{ inputs.version }}
secrets:
gh-token: ${{ secrets.GH_TOKEN }}
gh-token: ${{ secrets.GH_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/next-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
branch: ${{ steps.next-rc.outputs.branch }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
Expand Down Expand Up @@ -59,10 +59,10 @@ jobs:
NEW_RELEASE_VERSION="${BASE_TAG}-rc.${NEW_RELEASE_REVISION}"
echo "Latest release-candidate tag found: ${BASE_TAG}-rc.${LATEST_RELEASE_TAG}, creating: ${BASE_TAG}-rc.${NEW_RELEASE_REVISION}"

echo ::set-output name=release-version::$BASE_TAG
echo ::set-output name=new-rc-version::$NEW_RELEASE_VERSION
echo ::set-output name=commit-msg::$COMMIT_MSG
echo ::set-output name=branch::$CURRENT_BRANCH
echo "release-version=$BASE_TAG" >> $GITHUB_OUTPUT
echo "new-rc-version=$NEW_RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "commit-msg=$COMMIT_MSG" >> $GITHUB_OUTPUT
echo "branch=$CURRENT_BRANCH" >> $GITHUB_OUTPUT

process-chart:
if: ${{ (!contains(github.event.commits[0].message, '[skip-ci]')) && (needs.next-rc.outputs.new-rc-version != '') }}
Expand All @@ -72,4 +72,4 @@ jobs:
release-branch: ${{ needs.next-rc.outputs.branch }}
next-version: ${{ needs.next-rc.outputs.new-rc-version }}
secrets:
gh-token: ${{ secrets.GH_TOKEN }}
gh-token: ${{ secrets.GH_TOKEN }}
20 changes: 12 additions & 8 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ env:
IMAGE_TAG: ${{ github.event.pull_request.number }}-PR
IMAGE_SAVE_LOAD_DIR: /tmp/botkube-images

concurrency:
group: ${{ github.workflow }}-${{ github.ref }} # scope to for the current workflow
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} # cancel only PR related jobs

jobs:

save-image:
Expand All @@ -41,19 +45,19 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
version: latest
Expand Down Expand Up @@ -82,7 +86,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down Expand Up @@ -132,7 +136,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
Expand Down Expand Up @@ -194,13 +198,13 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
Expand Down Expand Up @@ -232,7 +236,7 @@ jobs:
--set image.tag="${IMAGE_TAG}" \

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
version: latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/process-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
outputs:
new-version: ${{ inputs.next-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ inputs.release-branch }}
token: ${{ secrets.gh-token }}
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
git push --tags

- name: Checkout to gh-pages for Helm
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: chart
ref: gh-pages
Expand Down
Loading
Loading