Skip to content
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
2 changes: 2 additions & 0 deletions .github/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
golang-version=1.17
golangci-lint-version=v1.42.1
140 changes: 140 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: CLI Tests

on:
push:
branches: [master, main, force_test, release-*]
tags: ['*']
pull_request:
branches: ['**']

jobs:
build:
name: Build and Lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Import environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: Set up Go ${{ env.golang-version }}
uses: actions/setup-go@v2.1.5
with:
go-version: ${{ env.golang-version }}
id: go

- name: Format
working-directory: cli
run: |
make go-fmt

- name: Vet
working-directory: cli
run: |
make go-vet

# TODO(paulfantom): figure-out why golangci-lint action crashes
#- name: Lint
# uses: golangci/golangci-lint-action@v2
# with:
# version: ${{ env.golangci-lint-version }}

- name: Build
working-directory: cli
run: |
make build

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Import environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: Set up Go ${{ env.golang-version }}
uses: actions/setup-go@v2.1.5
with:
go-version: ${{ env.golang-version }}

# TODO(paulfantom): Figure out better way to test it and ignore entries which are randomly generated and thus not reproducible in CI
#- name: Test static generation
# working-directory: ../
# run: |
# ./generate-deploy-script.sh
# git diff --exit-code

- name: Unit-Tests
working-directory: cli
run: |
make unit-tests

- name: Dependency-Tests
working-directory: cli
run: |
go test -v ./tests/dependency-tests

e2e:
name: E2E tests
runs-on: ubuntu-latest
strategy:
matrix:
kube-version:
- "1.21"
- "1.22"
- "1.23"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Import environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: Set up Go ${{ env.golang-version }}
uses: actions/setup-go@v2.1.5
with:
go-version: ${{ env.golang-version }}

- name: Build
working-directory: cli
run: |
make build

- name: Start kuberenetes cluster
working-directory: cli
env:
KUBE_VERSION: ${{ matrix.kube-version }}
run: |
make start-kind

- name: Helm tests
working-directory: cli
env:
KUBE_VERSION: ${{ matrix.kube-version }}
run: |
make helm-tests

- name: E2E tests
working-directory: cli
env:
KUBE_VERSION: ${{ matrix.kube-version }}
run: |
make e2e-tests

# Added to summarize the matrix
tests-result:
name: e2e results
if: always()
needs:
- e2e
runs-on: ubuntu-latest
steps:
- name: Mark the job as a success
if: needs.e2e.result == 'success'
run: exit 0
- name: Mark the job as a failure
if: needs.e2e.result != 'success'
run: exit 1
41 changes: 0 additions & 41 deletions .github/workflows/e2e-tests.yaml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/generate.yml

This file was deleted.

24 changes: 12 additions & 12 deletions .github/workflows/go-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2

- name: Import environment variables
run: cat ".github/env" >> $GITHUB_ENV

- name: Set up Go ${{ env.golang-version }}
uses: actions/setup-go@v2.1.5
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Run GoReleaser Test
go-version: ${{ env.golang-version }}

- name: GoReleaser Test
uses: goreleaser/goreleaser-action@v2
if: "!startsWith(github.ref, 'refs/tags/')"
with:
distribution: goreleaser
version: latest
workdir: cli
args: release --snapshot --skip-publish --rm-dist
-
name: GoReleaser Release

- name: GoReleaser Release
uses: goreleaser/goreleaser-action@v2
#release only on tags
if: startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-report-card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches: [master]

jobs:
build:
name: Build
report:
name: Report
runs-on: ubuntu-latest
steps:
- name: Request Report Update
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/go-schedule.yml

This file was deleted.

Loading