-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from DoodleScheduling/DK-3727
feat: update github actions and helm and refactor kustom
- Loading branch information
Showing
53 changed files
with
754 additions
and
916 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,74 +1,63 @@ | ||
name: e2e | ||
name: pr-build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
kind: | ||
e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 #v3.5.0 | ||
with: | ||
platforms: all | ||
- name: Setup Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
go-version: 1.19.x | ||
- name: Restore Go cache | ||
uses: actions/cache@v1 | ||
uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d #v3.2.2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-ghcache-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-ghcache- | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Setup Kubernetes | ||
uses: engineerd/[email protected] | ||
with: | ||
version: v0.11.1 | ||
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 | ||
- name: Setup Kustomize | ||
uses: fluxcd/pkg/actions/kustomize@main | ||
- name: Setup envtest | ||
uses: fluxcd/pkg/actions/envtest@main | ||
with: | ||
version: "1.19.0" | ||
- name: Setup Helm | ||
uses: fluxcd/pkg/actions/helm@main | ||
- name: Run controller tests | ||
- name: fmt | ||
run: make fmt | ||
- name: vet | ||
run: make vet | ||
- name: lint | ||
run: make lint | ||
- name: test | ||
run: make test | ||
- name: build | ||
run: make build | ||
- name: Send go coverage report | ||
uses: shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920 #v1.6.0 | ||
with: | ||
path-to-profile: coverage.out | ||
- name: Check if working tree is dirty | ||
run: | | ||
if [[ $(git diff --stat) != '' ]]; then | ||
git --no-pager diff | ||
echo 'run make test and commit changes' | ||
echo 'run <make test> and commit changes' | ||
exit 1 | ||
fi | ||
- name: Deploy certmanager | ||
run: | | ||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.yaml | ||
kubectl wait -n cert-manager --for=condition=Ready pods --all | ||
- name: Build container image | ||
run: | | ||
make docker-build IMG=test/k8s-pause:latest BUILD_PLATFORMS=linux/amd64 \ | ||
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \ | ||
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max" | ||
- name: Setup Kubernetes | ||
uses: engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 #v0.5.0 | ||
with: | ||
version: v0.17.0 | ||
- name: Deploy certmanager | ||
run: | | ||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.yaml | ||
kubectl wait -n cert-manager --for=condition=Ready pods --all | ||
- name: Load test image | ||
run: kind load docker-image test/k8s-pause:latest | ||
- name: Deploy controller | ||
|
@@ -84,10 +73,7 @@ jobs: | |
--namespace podinfo \ | ||
--set replicaCount=2 | ||
- name: Run k8s-pause tests | ||
run: bash ./scripts/e2e-test.sh | ||
- name: Logs | ||
run: | | ||
kubectl -n k8s-pause-system logs deploy/k8s-pause-controller-manager manager | ||
run: bash -e ./scripts/e2e-test.sh | ||
- name: Debug failure | ||
if: failure() | ||
run: | | ||
|
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,14 @@ | ||
name: pr-label | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
size-label: | ||
runs-on: ubuntu-latest | ||
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} | ||
steps: | ||
- name: size-label | ||
uses: "pascalgn/size-label-action@1619680c5ac1ef360b944bb56a57587ba4aa2af8" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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 |
---|---|---|
|
@@ -10,17 +10,21 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b #v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
- name: Install Helm | ||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 #v3.5 | ||
|
||
- name: Login to Github Container Registry using helm | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin | ||
|
||
- name: Package helm charts | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
charts_dir: ./chart | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
helm package chart/k8s-pause -d chart | ||
- name: Publish helm charts to Github Container Registry | ||
run: | | ||
repository=$(echo "${{ github.repository_owner }}" | tr [:upper:] [:lower:]) | ||
helm push ${{ github.workspace }}/chart/k8s-pause-*.tgz oci://ghcr.io/$repository/charts |
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 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 |
---|---|---|
|
@@ -23,3 +23,4 @@ testbin/* | |
*.swp | ||
*.swo | ||
*~ | ||
.DS_Store |
Oops, something went wrong.