Skip to content

fix: ensure files have a .json extension when downloading #12

fix: ensure files have a .json extension when downloading

fix: ensure files have a .json extension when downloading #12

Workflow file for this run

name: CI
on:
push:
# Run on the main branch
branches:
- main
# Also on PRs, just be careful not to publish anything
pull_request:
branches:
- main
# Allow to be called from other workflows (like "release")
workflow_call:
# But don't trigger on tags, as they are covered by the "release.yaml" workflow
# The overall idea is to be quick, but re-use output from previous steps.
# The quickest checks is formatting, so we do that first. Next is integration, and ci. For ci we split up backend
# and frontend, because they are somewhat independent.
#
# For the backend part, we run check, clippy, and test as they build upon each other. For the frontend, we run
# check and clippy, but test as a dedicated job, as we don't have a WASM test runner. Yet, check and clippy for wasm32
# are different.
jobs:
formatting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check formatting
run: |
cargo fmt --check
cargo fmt --check --manifest-path bommer/bommer-ui/Cargo.toml
cargo fmt --check --manifest-path spog/ui/Cargo.toml
uncommitted:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check if templates have uncommitted changes
run: |
pip3 install yq
make -C deploy/openshift
git diff --quiet deploy/openshift
if [ $? -gt 0 ]; then
echo "::error::Uncommitted changes to deploy/openshift (most likely template must be updated by running `make`)"
exit 1
fi
ci-backend:
runs-on: ubuntu-22.04
needs:
- formatting
steps:
- uses: actions/checkout@v3
- run: rustup component add clippy
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
bommer/bommer-ui/target/
spog/ui/target/
key: ${{ runner.os }}-cargo-backend-${{ hashFiles('**/Cargo.lock') }}
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: cargo check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test
ci-frontend-check:
runs-on: ubuntu-22.04
needs:
- formatting
steps:
- uses: actions/checkout@v3
- run: rustup component add clippy
- run: rustup target add wasm32-unknown-unknown
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
bommer/bommer-ui/target/
spog/ui/target/
key: ${{ runner.os }}-cargo-frontend-check-${{ hashFiles('**/Cargo.lock') }}
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: |
cargo check --target wasm32-unknown-unknown --manifest-path bommer/bommer-ui/Cargo.toml
cargo check --target wasm32-unknown-unknown --manifest-path spog/ui/Cargo.toml
- name: Clippy
run: |
cargo clippy --target wasm32-unknown-unknown --all-targets --all-features --manifest-path bommer/bommer-ui/Cargo.toml -- -D warnings
cargo clippy --target wasm32-unknown-unknown --all-targets --all-features --manifest-path spog/ui/Cargo.toml -- -D warnings
ci-frontend-test:
runs-on: ubuntu-22.04
needs:
- formatting
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
bommer/bommer-ui/target/
spog/ui/target/
key: ${{ runner.os }}-cargo-frontend-test-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: |
cargo test --manifest-path bommer/bommer-ui/Cargo.toml
cargo test --manifest-path spog/ui/Cargo.toml
integration:
needs:
- formatting
uses: ./.github/workflows/integration.yaml
# A virtual job, referenced by the branch protection rule
ci:
runs-on: ubuntu-22.04
needs:
- ci-backend
- ci-frontend-check
- ci-frontend-test
- integration
steps:
- run: echo 🎉