-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add mock cluster creation to integration test (#21)
* fix: add mock cluster creation to integration test * fix: add kubebuilder controller implementation as a showcase add more sonar coverage +semver: feature
- Loading branch information
Showing
77 changed files
with
4,488 additions
and
1,160 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 |
---|---|---|
|
@@ -8,33 +8,8 @@ permissions: | |
pull-requests: read | ||
|
||
jobs: | ||
set-version: | ||
test-pr-ci: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: mcr.microsoft.com/dotnet/sdk:6.0 | ||
outputs: | ||
semVer: ${{ steps.gitversion.outputs.semVer }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
- name: Set SemVer Version | ||
uses: gittools/actions/gitversion/[email protected] | ||
id: gitversion | ||
|
||
- name: echo VERSIONS | ||
run: | | ||
echo "REVISION -> $GITHUB_SHA" | ||
echo "VERSION -> $GITVERSION_SEMVER" | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.19-bullseye | ||
needs: set-version | ||
env: | ||
SEMVER: ${{ needs.set-version.outputs.semVer }} | ||
GIT_TAG: ${{ needs.set-version.outputs.semVer }} | ||
|
@@ -43,18 +18,21 @@ jobs: | |
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: install deps | ||
- name: git prep | ||
run: | | ||
apt update && apt install -y jq git | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
git config user.email ${{ github.actor }}[email protected] | ||
git config user.name ${{ github.actor }} | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19.x' | ||
- name: make test | ||
run: | | ||
export DOCKER_HOST=unix:///var/run/docker.sock | ||
make REVISION=$GITHUB_SHA test | ||
- name: Publish Junit style Test Report | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() # always run even if the previous step fails | ||
if: always() | ||
with: | ||
report_paths: '**/.coverage/report-junit.xml' | ||
- name: Analyze with SonarCloud | ||
|
@@ -66,5 +44,5 @@ jobs: | |
with: | ||
args: | ||
-Dsonar.projectVersion=${{ needs.set-version.outputs.semVer }} | ||
-Dsonar.go.tests.reportPaths=/github/workspace/controller/.coverage/report-junit.xml,/github/workspace/seeder/.coverage/report-junit.xml | ||
-Dsonar.go.coverage.reportPaths=/github/workspace/controller/.coverage/out,/github/workspace/seeder/.coverage/out | ||
-Dsonar.go.tests.reportPaths=/github/workspace/controller/.coverage/report-junit.xml,/github/workspace/seeder/.coverage/report-junit.xml,/github/workspace/kubebuilder-controller/.coverage/report-junit.xml | ||
-Dsonar.go.coverage.reportPaths=/github/workspace/controller/.coverage/out,/github/workspace/seeder/.coverage/out,/github/workspace/kubebuilder-controller/.coverage/out |
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 |
---|---|---|
|
@@ -64,8 +64,8 @@ jobs: | |
with: | ||
args: | ||
-Dsonar.projectVersion=${{ needs.set-version.outputs.semVer }} | ||
-Dsonar.go.tests.reportPaths=/github/workspace/controller/.coverage/report-junit.xml,/github/workspace/seeder/.coverage/report-junit.xml | ||
-Dsonar.go.coverage.reportPaths=/github/workspace/controller/.coverage/out,/github/workspace/seeder/.coverage/out | ||
-Dsonar.go.tests.reportPaths=/github/workspace/controller/.coverage/report-junit.xml,/github/workspace/seeder/.coverage/report-junit.xml,/github/workspace/kubebuilder-controller/.coverage/report-junit.xml | ||
-Dsonar.go.coverage.reportPaths=/github/workspace/controller/.coverage/out,/github/workspace/seeder/.coverage/out,/github/workspace/kubebuilder-controller/.coverage/out | ||
|
||
publish-binary: | ||
name: tag repo and publish binary | ||
|
@@ -89,8 +89,6 @@ jobs: | |
make GIT_TAG=$SEMVER REVISION=${{ github.sha }} PAT=${{ secrets.GITHUB_TOKEN }} build_ci | ||
- name: release library | ||
run: | | ||
git config user.email ${{ github.actor }}[email protected] | ||
git config user.name ${{ github.actor }} | ||
make GIT_TAG=$SEMVER REVISION=${{ github.sha }} tag | ||
- name: release cli | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: CI-ScratchPad-PR | ||
|
||
on: | ||
pull_request: | ||
branches: [ master, main ] | ||
|
||
jobs: | ||
kind-test-scratch-pad: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: dnitsch/gha-dind:0.0.6 | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
options: --privileged=true --group-add=docker | ||
env: | ||
GOVCS: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: DL tools | ||
run: | | ||
curl -LO https://dl.k8s.io/release/v1.26.1/bin/linux/amd64/kubectl | ||
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | ||
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64 | ||
install -o root -g root -m 0755 kind /usr/local/bin/kind | ||
- name: Get KubeConfig | ||
run: | | ||
export KUBECONFIG=$HOME/.kube/config | ||
export KIND_EXPERIMENTAL_DOCKER_NETWORK=${{ job.container.network }} | ||
echo 'kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
networking: | ||
apiServerAddress: "127.0.0.1" | ||
apiServerPort: 6443' > $PWD/kind-config.yml | ||
|
||
cat $PWD/kind-config.yml | ||
|
||
kind create cluster --config=$PWD/kind-config.yml | ||
|
||
echo "get internal" | ||
kind get kubeconfig --internal | ||
echo "get normal" | ||
kind get kubeconfig | ||
|
||
kubectl config set-cluster kind-kind --server=https://kind-control-plane:6443 | ||
|
||
kubectl get pods -n kube-system | ||
kubectl cluster-info | ||
kubectl apply -f ./kubebuilder-controller/config/crd/bases/seeder.dnitsch.net_reststrategies.yaml | ||
|
||
kubectl get pods -n kube-system |
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
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
Oops, something went wrong.