-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
4 changed files
with
70 additions
and
33 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,5 @@ | ||
--- | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
networking: | ||
apiServerAddress: "127.0.0.1" |
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,62 @@ | ||
name: Build & Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: [main] | ||
env: | ||
DOCKER_ENV_FILE: ".github/workflows/docker.env" | ||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4.1.7 | ||
# - name: Create k8s Kind Cluster | ||
# uses: helm/kind-action@v1 | ||
|
||
- name: setup@kindconfig | ||
run: | | ||
kind_in="${{ github.workspace }}/.github/config/kind.yml.in" | ||
kind_out="${{ github.workspace }}/.github/config/kind.yml" | ||
hostip=$(sh .github/scripts/get-host-ip.sh) | ||
sed "s/127.0.0.1/$hostip/g" $kind_in > $kind_out | ||
- name: setup@kubernetes | ||
uses: engineerd/setup-kind@v0.6.0 | ||
with: | ||
config: .github/config/kind.yml | ||
version: v0.24.0 | ||
image: kindest/node:v1.28.13 # ensure same as in Makefile | ||
|
||
- name: setup@kubeconfig | ||
run: | | ||
hostip=$(sh .github/scripts/get-host-ip.sh) | ||
sed "s/127.0.0.1/$hostip/g" $HOME/.kube/config > ${{ github.workspace }}/kubeconfig.yml | ||
- name: Build the Docker image | ||
run: docker build --target builder --file Dockerfile --tag allaboutapps/backup-ns:${GITHUB_SHA:8} . | ||
|
||
- name: Create container | ||
run: docker run -d --env-file $DOCKER_ENV_FILE --name=builder -it allaboutapps/backup-ns:${GITHUB_SHA:8} | ||
|
||
- name: Init Kind | ||
run: docker exec builder bash /app/test/init_kind.sh | ||
|
||
- name: make tidy | ||
run: docker exec builder make tidy | ||
|
||
- name: make build | ||
run: docker exec builder make build | ||
|
||
- name: make test | ||
run: docker exec builder make test | ||
|
||
- name: Stop container | ||
if: ${{ always() }} | ||
run: docker stop builder | ||
|
||
- name: Remove container | ||
if: ${{ always() }} | ||
run: docker rm builder |
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