Skip to content

Commit

Permalink
chore(ci): release unversioned snapshot when integration tests pass (#…
Browse files Browse the repository at this point in the history
…846)

Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak committed Dec 10, 2021
1 parent 09283fd commit c24e5bc
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 34 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This workflow is triggered on push or pull request for the main branch.
# It runs tests and various checks to validate that the proposed changes
# will not introduce any regression after merging the code to the main branch.
Expand Down Expand Up @@ -28,8 +29,8 @@ env:
KIND_VERSION: "v0.11.1"
KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6"
jobs:
unit-tests:
name: Run unit tests
verify-code:
name: Verify code
runs-on: ubuntu-20.04
steps:
- name: Setup Go
Expand All @@ -38,23 +39,28 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
- name: Cached Go dependencies
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run unit tests
run: make unit-tests
- name: Upload code coverage
uses: codecov/codecov-action@v2
- name: Verify Go code
uses: golangci/golangci-lint-action@v2
with:
files: ./coverage.txt
release-snapshot:
name: Release unversioned snapshot
needs:
- unit-tests
- verify-code
args: --verbose
version: latest
skip-pkg-cache: true
skip-build-cache: true
- name: Verify YAML code
uses: ibiqlik/action-yamllint@v3
- name: Vendor Go modules
run: go mod vendor
- name: Verify generated Go code
run: GOPATH="$(go env GOPATH)" ./hack/verify-codegen.sh
unit-tests:
name: Run unit tests
runs-on: ubuntu-20.04
steps:
- name: Setup Go
Expand All @@ -69,12 +75,13 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Release snapshot
uses: goreleaser/goreleaser-action@v2
- name: Run unit tests
run: make unit-tests
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
version: v0.183.0
args: release --snapshot --skip-publish --rm-dist
itest-starboard:
files: ./coverage.txt
itest-starboard-cli:
name: Run integration tests / Starboard CLI
needs:
- unit-tests
Expand Down Expand Up @@ -208,8 +215,12 @@ jobs:
uses: codecov/codecov-action@v2
with:
files: ./itest/starboard-operator/configauditreport/conftest/coverage.txt
verify-code:
name: Verify code
release-snapshot:
name: Release unversioned snapshot
needs:
- itest-starboard-cli
- itest-starboard-operator
- integration-operator-conftest
runs-on: ubuntu-20.04
steps:
- name: Setup Go
Expand All @@ -224,16 +235,8 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v2
- name: Release snapshot
uses: goreleaser/goreleaser-action@v2
with:
args: --verbose
version: latest
skip-pkg-cache: true
skip-build-cache: true
- name: Verify YAML code
uses: ibiqlik/action-yamllint@v3
- name: Vendor Go modules
run: go mod vendor
- name: Verify generated Go code
run: GOPATH="$(go env GOPATH)" ./hack/verify-codegen.sh
version: v1.1.0
args: release --snapshot --skip-publish --rm-dist
1 change: 1 addition & 0 deletions .github/workflows/mkdocs-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This is a manually triggered workflow to build and publish the MkDocs from the
# main branch to GitHub pages at https://aquasecurity.github.io/starboard.
name: Deploy documentation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-helm-chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# This is a manually triggered workflow to package and upload the Helm chart from the
# main branch to Aqua Security repository at https://github.com/aquasecurity/helm-charts.

name: Publish Helm chart

on:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
# This workflow is triggered whenever we release a new version of Starboard
# by creating an annotated Git tag and pushing it to the upstream Git repository.
#
# git tag -a v0.0.1 -m 'Release v0.0.1'
# git push upstream v0.0.1
name: Release
on:
push:
Expand Down Expand Up @@ -183,7 +189,7 @@ jobs:
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: v0.183.0
version: v1.1.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit c24e5bc

Please sign in to comment.