fix(ci): update devcontainers, github actions config, bats action (#928)
This commit is contained in:
parent
3682468b5f
commit
138e569841
|
|
@ -1,8 +1,6 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube
|
||||
// For format details, see https://aka.ms/devcontainer.json
|
||||
{
|
||||
"name": "Kubernetes - Minikube-in-Docker",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"name": "Jenkins kubernetes operator devcontainer",
|
||||
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
|
||||
|
||||
"features": {
|
||||
|
|
@ -13,7 +11,7 @@
|
|||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
|
||||
"version": "latest",
|
||||
"helm": "latest",
|
||||
"minikube": "latest"
|
||||
"minikube": "none"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/go:1": {
|
||||
"version": "1.15",
|
||||
|
|
@ -24,20 +22,35 @@
|
|||
},
|
||||
"ghcr.io/edouard-lopez/devcontainer-features/bats:0": {
|
||||
"version": "latest"
|
||||
},
|
||||
"ghcr.io/brokenpip3/devcontainers-bats/bats-libs:0": {
|
||||
}
|
||||
}
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
},
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "kubectl version",
|
||||
"postCreateCommand": "go version",
|
||||
|
||||
// Use 'postStartCommand' to run commands after the container is created like starting minikube.
|
||||
// "postStartCommand": "nohup bash -c 'minikube start &' > minikube.log 2>&1",
|
||||
|
||||
// Configure tool-specific properties.
|
||||
// "customizations": {},
|
||||
"customizations": {
|
||||
"codespaces": {
|
||||
"openFiles": [
|
||||
"Makefile"
|
||||
]
|
||||
},
|
||||
// install some vscode extensions
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"golang.Go",
|
||||
"jetmartin.bats",
|
||||
"ms-kubernetes-tools.vscode-kubernetes-tools",
|
||||
"budparr.language-hugo-vscode",
|
||||
"GitHub.copilot",
|
||||
"GitHub.copilot-chat"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,25 @@ updates:
|
|||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
groups:
|
||||
golang:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/website"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
groups:
|
||||
npm:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "daily"
|
||||
groups:
|
||||
actions:
|
||||
patterns:
|
||||
- "*"
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ jobs:
|
|||
- name: Ensure Golang runtime dependencies
|
||||
run: make go-dependencies
|
||||
|
||||
- name: Setup BATS
|
||||
uses: mig4/setup-bats@v1
|
||||
- name: Setup Bats and libs
|
||||
uses: brokenpip3/setup-bats-libs@1.5.2
|
||||
with:
|
||||
bats-version: 1.9.0
|
||||
|
||||
- name: Setup Bats libs
|
||||
uses: brokenpip3/setup-bats-libs@0.1.0
|
||||
support-path: "${{ github.workspace }}/.bats/bats-support"
|
||||
assert-path: "${{ github.workspace }}/.bats/bats-assert"
|
||||
detik-path: "${{ github.workspace }}/.bats/bats-detik"
|
||||
file-path: "${{ github.workspace }}/.bats/bats-file"
|
||||
|
||||
- name: Kind setup
|
||||
uses: helm/kind-action@v1.5.0
|
||||
|
|
@ -58,4 +58,6 @@ jobs:
|
|||
cluster_name: ${{env.KIND_CLUSTER_NAME}}
|
||||
|
||||
- name: Jenkins Operator - bats tests
|
||||
env:
|
||||
BATS_LIB_PATH: "${{ github.workspace }}/.bats"
|
||||
run: make bats-tests
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -387,11 +387,11 @@ ifndef BUILD_PRESENT
|
|||
bats-tests: container-runtime-build-amd64 ## Run bats tests
|
||||
@echo "+ $@"
|
||||
kind load docker-image ${IMAGE_NAME} --name $(KIND_CLUSTER_NAME)
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p -x test/bats
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p test/bats
|
||||
else
|
||||
bats-tests: ## Run bats tests
|
||||
@echo "+ $@"
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p -x test/bats
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p test/bats
|
||||
endif
|
||||
|
||||
.PHONY: crc-start
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
_common_setup() {
|
||||
export BATS_LIB_PATH="/usr/lib/"
|
||||
export BATS_LIB_PATH="${BATS_LIB_PATH}:/usr/lib"
|
||||
bats_load_library bats-support
|
||||
bats_load_library bats-assert
|
||||
bats_load_library bats-file
|
||||
|
|
|
|||
Loading…
Reference in New Issue