Make Botkube Cloud plugins open-source #175
Workflow file for this run
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
name: Branch and PR build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || 'branch' }} # scope to for the current workflow | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} # cancel only PR related jobs | |
env: | |
GOLANGCI_LINT_TIMEOUT: 5m | |
GORELEASER_CURRENT_TAG: "v0.0.0-latest" | |
BUCKET_NAME: botkube-cloud-plugins-latest | |
jobs: | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
- name: "Set up Go" | |
uses: actions/setup-go@v5 | |
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: "Check code quality" | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }} | |
test: | |
name: Test code | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
- name: "Set up Go" | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: 'true' | |
- name: "Run tests" | |
run: make test | |
build-plugins: | |
name: Build plugins without publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
if: github.event_name == 'pull_request' | |
needs: [lint, test] | |
steps: | |
- name: "Checkout code" | |
uses: actions/checkout@v4 | |
- name: "Set up Go" | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Install GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
install-only: true | |
version: latest | |
- name: Build plugins and generate plugins index.yaml | |
env: | |
PLUGIN_DOWNLOAD_URL_BASE_PATH: "" | |
run: | | |
make build-plugins-archives | |
USE_ARCHIVE=true make gen-plugin-index |