-
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.
- Loading branch information
Backstage
committed
Jul 23, 2024
0 parents
commit 721e4af
Showing
33 changed files
with
4,523 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,5 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
threshold: 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,19 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "cargo" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gitsubmodule" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
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,32 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/cargo-build.yml | ||
- rust-toolchain.toml | ||
- "openapi/*.json" | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/cargo-build.yml | ||
- rust-toolchain.toml | ||
- "openapi/*.json" | ||
permissions: read-all | ||
name: cargo build | ||
jobs: | ||
cargobuild: | ||
name: cargo build | ||
runs-on: ubuntu-latest-8-cores | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Run cargo build | ||
run: | | ||
cargo build --workspace | ||
shell: bash |
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,33 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/cargo-clippy.yml | ||
- "rust-toolchain.toml" | ||
- "openapi/*.json" | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/cargo-clippy.yml | ||
- "rust-toolchain.toml" | ||
- "openapi/*.json" | ||
name: cargo clippy | ||
jobs: | ||
cargoclippy: | ||
name: cargo clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: clippy | ||
- name: Run clippy | ||
run: cargo clippy --workspace --tests -- -D warnings | ||
- name: Cargo check --release | ||
run: cargo check --release |
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,35 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**.rs" | ||
- "engine" | ||
- "rust-toolchain" | ||
- "rust-toolchain.toml" | ||
- .github/workflows/cargo-fmt.yml | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- "rust-toolchain" | ||
- "rust-toolchain.toml" | ||
- .github/workflows/cargo-fmt.yml | ||
- "engine" | ||
permissions: | ||
packages: read | ||
contents: read | ||
name: cargo fmt | ||
jobs: | ||
cargofmt: | ||
name: cargo fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt | ||
rustflags: "" # use our .cargo/config.toml | ||
- name: Run cargo fmt | ||
run: | | ||
cargo fmt -- --check | ||
shell: bash |
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,40 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/cargo-test.yml | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/cargo-test.yml | ||
workflow_dispatch: | ||
permissions: read-all | ||
name: cargo test | ||
jobs: | ||
cargotest: | ||
name: cargo test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- uses: taiki-e/install-action@cargo-llvm-cov | ||
- uses: taiki-e/install-action@nextest | ||
- name: cargo test | ||
shell: bash | ||
run: | | ||
cargo llvm-cov nextest --all --lcov --output-path lcov.info --test-threads=1 --no-fail-fast | ||
# TODO: enable codecov | ||
# - name: Upload to codecov.io | ||
# uses: codecov/codecov-action@v3 | ||
# with: | ||
# token: | ||
# fail_ci_if_error: true | ||
# flags: unittests | ||
# verbose: true | ||
# files: lcov.info |
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,43 @@ | ||
name: deployment | ||
permissions: | ||
packages: write | ||
contents: read | ||
pull-requests: write | ||
on: | ||
push: | ||
branches: main | ||
paths: | ||
- "**/*.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- Dockerfile | ||
- .github/workflows/docker-image.yml | ||
- .github/workflows/deployment.yml | ||
- kubernetes/**.yaml | ||
workflow_dispatch: | ||
inputs: | ||
concurrency: | ||
group: deploy-production | ||
cancel-in-progress: false | ||
jobs: | ||
docker-image: | ||
uses: ./.github/workflows/docker-image.yml | ||
secrets: inherit | ||
argocd: | ||
needs: [docker-image] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
# required | ||
app-id: ${{ secrets.GH_ORG_APP_ID }} | ||
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
- name: Dispatch deploy to infra | ||
uses: peter-evans/repository-dispatch@v2 | ||
with: | ||
token: ${{ steps.app-token.outputs.token }}} | ||
repository: kittycad/infra | ||
event-type: kustomize-deploy | ||
client-payload: '{"update_type": "appset", "image_name": "ghcr.io/kittycad/machine-api", "app_name": "machine-api", "sha": "${{github.sha}}"}' |
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-image | ||
permissions: | ||
packages: write | ||
contents: read | ||
pull-requests: write | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.rs" | ||
- Cargo.toml | ||
- Cargo.lock | ||
- rust-toolchain.toml | ||
- Dockerfile | ||
- .github/workflows/docker-image.yml | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_call: | ||
workflow_dispatch: | ||
inputs: | ||
concurrency: | ||
group: docker-image-${{ github.ref }} | ||
cancel-in-progress: false | ||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest-8-cores | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Packages Docker Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Set up env vars | ||
shell: bash | ||
run: | | ||
maybe_branch=${GITHUB_HEAD_REF//\//-} | ||
BRANCH=${maybe_branch:-main} | ||
echo "BRANCH=${BRANCH}" >> "$GITHUB_ENV" | ||
if [ "$BRANCH" = "main" ]; then | ||
echo "BUILD_MODE=release" >> "$GITHUB_ENV" | ||
else | ||
echo "BUILD_MODE=debug" >> "$GITHUB_ENV" | ||
fi | ||
id: setup_env | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
file: ./Dockerfile | ||
|
||
build-args: | | ||
BUILD_MODE=${{ env.BUILD_MODE }} | ||
tags: | | ||
ghcr.io/kittycad/${{ github.event.repository.name }}:${{ env.BRANCH }} | ||
ghcr.io/kittycad/${{ github.event.repository.name }}:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha | ||
- name: Docker Scout | ||
id: docker-scout | ||
uses: docker/scout-action@v1 | ||
with: | ||
image: ghcr.io/kittycad/${{ github.event.repository.name }}:${{ env.BRANCH }} | ||
organization: zoodotdev | ||
command: cves | ||
ignore-base: true | ||
ignore-unchanged: true | ||
only-fixed: true |
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 @@ | ||
/target |
Oops, something went wrong.