Skip to content

Commit

Permalink
Merge branch 'master' into ksctl-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek authored Mar 14, 2024
2 parents da7c46b + e438b7f commit d442bd3
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every day

Check failure on line 7 in .github/dependabot.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

7:54 [trailing-spaces] trailing spaces
interval: "daily"
13 changes: 13 additions & 0 deletions .github/workflows/ci-check-gomod-alt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# alternative workflow to ensure that the required status checks on the PR are handled
# see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
name: ci-check-gomod # same name
on:

Check warning on line 4 in .github/workflows/ci-check-gomod-alt.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

4:1 [truthy] truthy value should be one of [false, true]
pull_request:
paths-ignore:
- 'go.mod'
jobs:
gomodreplacements:
name: go.mod replacements
runs-on: ubuntu-20.04
steps:
- run: 'echo "No check required" '
22 changes: 22 additions & 0 deletions .github/workflows/ci-check-gomod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ci-check-gomod
on:

Check warning on line 2 in .github/workflows/ci-check-gomod.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

2:1 [truthy] truthy value should be one of [false, true]
pull_request:
branches:
- master
paths:
- 'go.mod'

jobs:
gomodreplacements:
name: go.mod replacements
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: check
run: |
if [[ -n "$(grep 'replace github.com/kubesaw/.*' go.mod || true)" ]]; then
echo "forbidden replacement in go.mod"
exit 1
fi
86 changes: 86 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: ci-build
on:

Check warning on line 2 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

2:1 [truthy] truthy value should be one of [false, true]
push:
branches:
- master
tags-ignore:
- '*.*'
pull_request:
branches:
- master

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
name: Test on ${{ matrix.os }}

steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.20.x

- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles ('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: |
make build
- name: Test
run: |
make test-with-coverage
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./out/coverage/coverage.txt
flags: unittests # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

golangci:
name: GolangCI Lint
runs-on: ubuntu-latest

Check failure on line 56 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

56:1 [trailing-spaces] trailing spaces
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.20.x

Check failure on line 62 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

62:1 [trailing-spaces] trailing spaces
- name: Checkout code
uses: actions/checkout@v4

Check failure on line 65 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

65:1 [trailing-spaces] trailing spaces
- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.56.2
skip-pkg-cache: true
skip-build-cache: true
args: --config=./.golangci.yml --verbose

Check failure on line 73 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

73:1 [trailing-spaces] trailing spaces
yammlint:
name: YAML Lint
runs-on: ubuntu-latest

Check failure on line 77 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

77:1 [trailing-spaces] trailing spaces
steps:
- name: Checkout code
uses: actions/checkout@v4

Check failure on line 81 in .github/workflows/workflow.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

81:1 [trailing-spaces] trailing spaces
- name: Install yamllint
run: pip install yamllint

- name: Lint YAML files
run: yamllint -c .yamllint ./

0 comments on commit d442bd3

Please sign in to comment.