testing new action #2
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
env: | |
GOLANGCI_VERSION: "v1.56.2" | |
jobs: | |
detect-noop: | |
name: Detect noop | |
runs-on: ubuntu-latest | |
outputs: | |
noop: ${{ steps.noop.outputs.should_skip }} | |
steps: | |
- name: Detect no-op changes | |
id: noop | |
uses: fkirc/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
paths_ignore: '["*.md","**.md.gotmpl","examples/**"]' | |
concurrent_skipping: false | |
detect-ent: | |
name: Detect enterprise | |
runs-on: ubuntu-latest | |
outputs: | |
ent: ${{ steps.ent.outputs.ent }} | |
steps: | |
- name: Detect enterprise | |
id: ent | |
env: | |
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} | |
if: "${{ env.DOCKERHUB_USER != '' }}" | |
run: | | |
echo "ent='true'" >> $GITHUB_OUTPUT | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: detect-noop | |
if: ${{ needs.detect-noop.outputs.noop != 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache: true | |
- name: GolangCI Lint | |
uses: golangci/golangci-lint-action@v5 | |
with: | |
version: ${{ env.GOLANGCI_VERSION }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: detect-noop | |
if: ${{ needs.detect-noop.outputs.noop != 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache: true | |
- name: Build | |
run: make build | |
- name: Build Enterprise | |
run: make build-ent | |
- name: Build Docker | |
run: make docker-build | |
- name: Build Enterprise Docker | |
run: make docker-build-ent | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: detect-noop | |
if: ${{ needs.detect-noop.outputs.noop != 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache: true | |
- name: Cluster | |
run: | | |
make cluster-ha | |
make install | |
make install-minio | |
make net | |
- name: Test | |
run: make test | |
test-ent: | |
name: Test enterprise | |
runs-on: ubuntu-latest | |
needs: | |
- detect-noop | |
- detect-ent | |
if: ${{ needs.detect-noop.outputs.noop != 'true' && needs.detect-ent.outputs.ent != '' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache: true | |
- name: Login DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login GAR | |
uses: docker/login-action@v3 | |
with: | |
registry: us-central1-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
- name: Cluster | |
run: | | |
make cluster | |
make registry | |
make install-ent | |
make install-minio | |
make net | |
- name: Test | |
run: make test-ent | |
olm: | |
name: OLM | |
runs-on: ubuntu-latest | |
needs: detect-noop | |
if: ${{ needs.detect-noop.outputs.noop != 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Validate | |
run: make bundle-validate | |
- name: Build image | |
run: make bundle-build | |
- name: Cluster | |
run: make cluster | |
- name: Scorecard | |
run: make bundle-scorecard | |
gen: | |
name: Generate artifacts | |
runs-on: ubuntu-latest | |
needs: detect-noop | |
if: ${{ needs.detect-noop.outputs.noop != 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Generate | |
run: make generate | |
- name: Check diff | |
uses: mmontes11/[email protected] | |
with: | |
message: Generated artifacts are not up to date. Run 'make generate' and commit the changes. | |
licenses: | |
name: Generate licenses | |
runs-on: ubuntu-latest | |
needs: detect-noop | |
if: ${{ needs.detect-noop.outputs.noop != 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Generate | |
run: make licenses | |
- name: Check licenses | |
run: | | |
if [ ! -d "licenses" ] || [ ! -n "$(ls -A licenses)" ]; then | |
echo "Error: No licenses generated" | |
exit 1 | |
fi |