-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
- Loading branch information
0 parents
commit a6638e6
Showing
165 changed files
with
10,163 additions
and
0 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,3 @@ | ||
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
# Ignore build and test binaries. | ||
bin/ |
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 @@ | ||
use flake; |
Validating CODEOWNERS rules …
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,9 @@ | ||
# CODEOWNERS | ||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
|
||
# NOTE: Order is important; the last matching pattern takes the most precedence. When someone opens a pull request that | ||
# only modifies files under a certain matching pattern, only those code owners will be requested for a review. | ||
|
||
# These owners will be the default owners for everything in the repository. Unless a later match takes precedence, they | ||
# will be requested for review when someone opens a pull request. | ||
* @calebschoepp @endocrimes @lann @michelleN |
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,13 @@ | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Go Build and Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
packages: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.x' | ||
cache: true | ||
|
||
- name: Setup gotestsum | ||
uses: autero1/action-gotestsum@v2.0.0 | ||
with: | ||
gotestsum_version: "1.8.2" | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Build | ||
run: CGO_ENABLED=0 go build -v ./... | ||
|
||
- name: Setup EnvTest | ||
run: make envtest | ||
|
||
- name: Test | ||
run: | | ||
mkdir .results | ||
gotestsum \ | ||
--junitfile .results/results.xml \ | ||
--jsonfile .results/results.json \ | ||
--format testname \ | ||
-- -coverprofile=.results/cover.out ./... | ||
- name: Test Summary | ||
uses: test-summary/action@v2 | ||
with: | ||
paths: ".results/results.xml" | ||
if: always() | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: results.xml | ||
path: ./.results/results.xml | ||
if: always() | ||
- name: Upload test coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cover.out | ||
path: ./.results/cover.out | ||
if: always() | ||
- name: Upload Go test results json | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: results.json | ||
path: ./.results/results.json | ||
|
||
lint_go: | ||
name: lint go | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.x' | ||
- uses: actions/checkout@v4 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.55.2 | ||
args: --timeout=10m | ||
|
||
lint_shell: | ||
name: lint shell | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ShellCheck | ||
uses: ludeeus/action-shellcheck@master | ||
|
||
lint_chart: | ||
name: lint chart | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.x' | ||
cache: true | ||
- name: Install dependencies | ||
run: go mod download | ||
- name: Install helm | ||
uses: Azure/setup-helm@v3 | ||
with: | ||
version: v3.14.0 | ||
- name: Lint chart | ||
run: make helm-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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup version info | ||
run: echo "VERSION=$(date +%Y%m%d-%H%M%S)-g$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and Push PR - Ephemeral | ||
uses: docker/build-push-action@v5 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
context: . | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
tags: | | ||
ttl.sh/spoopy-operator-pr-${{ github.event.pull_request.number }}:24h | ||
- uses: mshick/add-pr-comment@v2 | ||
if: (github.event_name == 'pull_request') && ${{ success() }} | ||
with: | ||
message: | | ||
This PR now has an image available for testing: | ||
``` | ||
ttl.sh/spoopy-operator-pr-${{ github.event.pull_request.number }}:24h | ||
``` | ||
- name: Build and Push | ||
uses: docker/build-push-action@v5 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
context: . | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
tags: | | ||
ghcr.io/spinkube/spin-operator:${{ env.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint-markdown: | ||
name: Lint all markdown files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Lint markdown | ||
run: | | ||
make lint-markdown |
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,42 @@ | ||
name: Publish Sample Apps | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
publish-image: | ||
name: Publish sample app images | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
app: [cpu-load-gen, hello-world] | ||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set the release version | ||
shell: bash | ||
run: | | ||
echo "RELEASE_VERSION=$(date +%Y%m%d-%H%M%S)-g$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- name: Install Spin | ||
uses: fermyon/actions/spin/setup@v1 | ||
|
||
- name: Install TinyGo | ||
uses: acifani/setup-tinygo@v2 | ||
|
||
- name: Build and push versioned image | ||
uses: fermyon/actions/spin/push@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
registry_username: ${{ github.actor }} | ||
registry_password: ${{ secrets.GITHUB_TOKEN }} | ||
registry_reference: "ghcr.io/spinkube/spin-operator/${{ matrix.app }}:${{ env.RELEASE_VERSION }}" | ||
manifest_file: apps/${{ matrix.app }}/spin.toml |
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,55 @@ | ||
name: Smoketest | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21.x" | ||
|
||
- name: setup k3d | ||
uses: engineerd/configurator@v0.0.10 | ||
with: | ||
name: k3d | ||
url: https://github.com/k3d-io/k3d/releases/download/v5.6.0/k3d-linux-amd64 | ||
|
||
- name: start k3d cluster | ||
run: | | ||
k3d cluster create wasm-cluster \ | ||
--image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.10.0 \ | ||
--port "8081:80@loadbalancer" \ | ||
--agents 2 | ||
- name: apply runtime class | ||
run: kubectl apply -f spin-runtime-class.yaml | ||
|
||
- name: start controller | ||
timeout-minutes: 5 | ||
run: | | ||
make install | ||
make run & | ||
timeout 300s bash -c 'until curl -s http://localhost:8082/healthz; do echo "waiting for controller to start"; sleep 2; done' | ||
echo "" | ||
echo "controller started successfully" | ||
- name: run spin app | ||
run: | | ||
kubectl apply -f config/samples/shim-executor.yaml | ||
kubectl apply -f config/samples/simple.yaml | ||
kubectl rollout status deployment simple-spinapp --timeout 90s | ||
kubectl port-forward svc/simple-spinapp 8083:80 & | ||
timeout 15s bash -c 'until curl -f -vvv http://localhost:8083/hello; do sleep 2; done' | ||
- name: Verify curl | ||
run: curl localhost:8083/hello |
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,31 @@ | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
bin/* | ||
Dockerfile.cross | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Kubernetes Generated files - skip generated files, except for vendored files | ||
|
||
!vendor/**/zz_generated.* | ||
|
||
# editor and IDE paraphernalia | ||
.idea | ||
.vscode | ||
*.swp | ||
*.swo | ||
*~ | ||
.direnv/ | ||
|
||
# Helm chart dependencies | ||
|
||
charts/spin-operator/charts |
Oops, something went wrong.