-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ed8cef
commit f95c297
Showing
18 changed files
with
253 additions
and
166 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
strict_env | ||
source_env_if_exists .envrc.local-asdf | ||
use_asdf | ||
PATH_add .local/bin | ||
source_env_if_exists .envrc.local | ||
# Automatically sets up your devbox environment whenever you cd into this | ||
# directory via our direnv integration: | ||
|
||
eval "$(devbox generate direnv --print-envrc)" | ||
|
||
# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/ | ||
# for more details |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,17 @@ jobs: | |
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install asdf | ||
uses: asdf-vm/actions/setup@v2 | ||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- name: Run unit tests | ||
run: make test | ||
run: devbox run -- make test | ||
|
||
- name: Annotate tests | ||
if: always() | ||
|
@@ -49,43 +55,66 @@ jobs: | |
with: | ||
files: "test/e2e/**/*.go" | ||
|
||
- name: Install asdf | ||
if: steps.check_e2e_files.outputs.files_exists == 'true' | ||
uses: asdf-vm/actions/setup@v2 | ||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- if: steps.check_e2e_files.outputs.files_exists == 'true' | ||
name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- if: steps.check_e2e_files.outputs.files_exists == 'true' | ||
name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- name: Run e2e tests | ||
if: steps.check_e2e_files.outputs.files_exists == 'true' | ||
run: make e2e-test | ||
- if: steps.check_e2e_files.outputs.files_exists == 'true' | ||
name: Run e2e tests | ||
run: devbox run -- make e2e-test | ||
|
||
lint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Gather tool versions | ||
uses: jimmidyson/asdf-parse-tool-versions@v2 | ||
id: versions | ||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- name: Collect tool versions | ||
run: | | ||
echo GO_VERSION="$(devbox run -- go version | cut -d' ' -f 3 | grep -o '[0-9.]\+')" >>"${GITHUB_ENV}" | ||
echo GOLANGCI_LINT_VERSION="$(devbox run -- golangci-lint version --format short)" >>"${GITHUB_ENV}" | ||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
fail_on_error: true | ||
reporter: github-pr-review | ||
go_version: ${{ fromJson(steps.versions.outputs.tools).golang }} | ||
golangci_lint_version: v${{ fromJson(steps.versions.outputs.tools).golangci-lint }} | ||
go_version: ${{ env.GO_VERSION }} | ||
golangci_lint_version: v${{ env.GOLANGCI_LINT_VERSION }} | ||
|
||
generated: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install asdf | ||
uses: asdf-vm/actions/setup@v2 | ||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- name: Check generated files | ||
run: make go-generate | ||
run: devbox run -- make go-generate | ||
|
||
- name: Verify no changed files | ||
uses: tj-actions/verify-changed-files@v16 | ||
|
@@ -103,28 +132,22 @@ jobs: | |
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Gather tool versions | ||
uses: jimmidyson/asdf-parse-tool-versions@v2 | ||
id: versions | ||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ fromJson(steps.versions.outputs.tools).golang }} | ||
check-latest: false | ||
cache: true | ||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- uses: mfinelli/setup-shfmt@v2 | ||
- name: Set up pre-commit cache | ||
uses: actions/cache@v3 | ||
with: | ||
shfmt-version: ${{ fromJson(steps.versions.outputs.tools).shfmt }} | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Install asdf | ||
uses: asdf-vm/actions/setup@v2 | ||
|
||
- name: Install helm-docs | ||
run: make install-tool.helm-docs | ||
|
||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files --show-diff-on-failure | ||
- name: Run pre-commit | ||
run: devbox run -- make pre-commit | ||
env: | ||
SKIP: no-commit-to-branch,golangci-lint,go-generate | ||
SKIP: no-commit-to-branch,golangci-lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,16 +25,22 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Install tools via asdf | ||
uses: asdf-vm/actions/install@v2 | ||
|
||
- name: Build | ||
run: make build-snapshot | ||
run: devbox run -- make build-snapshot | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,29 +30,36 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
# Setup github authentication to ensure Github's rate limits are not hit. | ||
- if: ${{ steps.release-please.outputs.release_created }} | ||
name: Install tools via asdf | ||
uses: asdf-vm/actions/install@v2 | ||
name: Configure nix GitHub access-tokens | ||
run: | | ||
mkdir -p ~/.config/nix | ||
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" >>~/.config/nix/nix.conf | ||
- if: ${{ steps.release-please.outputs.release_created }} | ||
name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
|
||
- if: ${{ steps.release-please.outputs.release_created }} | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- if: ${{ steps.release-please.outputs.release_created }} | ||
name: Release | ||
run: make release | ||
run: devbox run -- make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- if: ${{ steps.release-please.outputs.release_created }} | ||
- if: ${{ steps.release-please.outputs.release_created }} | ||
name: Publish Helm chart | ||
uses: stefanprodan/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
app_version: ${{ steps.release-please.outputs.tag_name }} | ||
chart_version: ${{ steps.release-please.outputs.tag_name }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
app_version: ${{ steps.release-please.outputs.tag_name }} | ||
chart_version: ${{ steps.release-please.outputs.tag_name }} | ||
target_dir: repo |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
github.com/oligot/[email protected] | ||
gotest.tools/[email protected] | ||
github.com/segmentio/[email protected] | ||
github.com/google/go-containerregistry/cmd/[email protected] |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,3 @@ | |
REPO_ROOT := $(CURDIR) | ||
|
||
include make/all.mk | ||
|
||
ASDF_VERSION=v0.10.2 | ||
|
||
CI_DOCKER_BUILD_ARGS=ASDF_VERSION=$(ASDF_VERSION) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"packages": [ | ||
"clusterctl@latest", | ||
"crane@latest", | ||
"ginkgo@latest", | ||
"go@latest", | ||
"gojq@latest", | ||
"golangci-lint@latest", | ||
"golines@latest", | ||
"google-cloud-sdk@latest", | ||
"goreleaser@latest", | ||
"gotestsum@latest", | ||
"helm-docs@latest", | ||
"kubebuilder@latest", | ||
"kubernetes-code-generator@latest", | ||
"kubernetes-controller-tools@latest", | ||
"kubernetes-helm@latest", | ||
"pre-commit@latest", | ||
"shfmt@latest", | ||
"upx@latest" | ||
], | ||
"shell": { | ||
"init_hook": [ | ||
"echo 'Welcome to devbox!' > /dev/null" | ||
], | ||
"scripts": { | ||
"test": [ | ||
"echo \"Error: no test specified\" && exit 1" | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.