Skip to content

website preview

website preview #1728

Workflow file for this run

name: ci
on:
push:
branches:
- master
pull_request:
paths-ignore:
- "website/**"
jobs:
build:
name: build & test
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: setup environment
uses: ./.github/actions/setup
- name: check
run: cargo check
- name: "build (bin: conductor)"
run: cargo build --bin conductor --release
- name: "build (bin: cloudflare_worker_wasm)"
working-directory: bin/cloudflare_worker
run: cargo install -q worker-build && worker-build
- name: test
run: cargo test --workspace --exclude smoke_tests -- --nocapture
env:
RUST_BACKTRACE: full
- name: install node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: install napi deps
working-directory: libs/napi
run: yarn install
- name: build napi lib
working-directory: libs/napi
run: yarn build
smoke-test:
name: smoke test
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: setup environment
uses: ./.github/actions/setup
- name: run containers
working-directory: libs/smoke_tests/
run: docker compose -f docker-compose.yaml up -d --remove-orphans --wait --force-recreate
- uses: JarvusInnovations/background-action@v1
name: run test server in background
with:
run: cargo run
working-directory: tests/test-server
wait-on: http-get://127.0.0.1:4000
tail: true
wait-for: 10m
log-output-if: failure
log-output: true
- uses: JarvusInnovations/background-action@v1
name: run gateway in background (binary)
with:
run: cargo run --bin conductor -- ./libs/smoke_tests/test_gw.yaml
wait-on: http-get://127.0.0.1:9000/graphql
tail: true
wait-for: 15m
log-output-if: failure
log-output: true
- name: run tests (binary)
working-directory: libs/smoke_tests/
run: cargo test --features binary -- --nocapture
env:
CONDUCTOR_URL: http://127.0.0.1:9000
RUST_BACKTRACE: full
- name: restart containers
working-directory: libs/smoke_tests/
run: |
docker compose down
docker compose -f docker-compose.yaml up -d --remove-orphans --wait --force-recreate
- uses: the-guild-org/shared-config/setup@main
name: setup env (wasm)
with:
nodeVersion: 20
packageManager: pnpm
workingDirectory: bin/cloudflare_worker
packageManagerVersion: 8
- uses: JarvusInnovations/background-action@v1
name: run gateway in background (wasm)
with:
working-directory: bin/cloudflare_worker
run: pnpm start:smoke
wait-on: http-get://127.0.0.1:8787/graphql
tail: true
wait-for: 15m
log-output-if: failure
log-output: true
- name: run tests (wasm)
working-directory: libs/smoke_tests/
run: cargo test --features wasm -- --nocapture
env:
CONDUCTOR_URL: http://127.0.0.1:8787
RUST_BACKTRACE: full
graphql-over-http:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: setup environment
uses: ./.github/actions/setup
- name: figure out versions
id: versions
working-directory: ./tests/graphql-over-http
run:
PNPM_VERSION=$(cat package.json | jq -r '.packageManager' | awk -F@ '{print $2}')
NODE_VERSION=$(cat package.json | jq -r '.engines.node' | awk -F= '{print $2}')
echo "pnpm=$PNPM_VERSION" >> $GITHUB_OUTPUT
echo "nodejs=$NODE_VERSION" >> $GITHUB_OUTPUT
- uses: the-guild-org/shared-config/setup@main
name: setup env
with:
nodeVersion: ${{ steps.versions.outputs.nodejs }}
packageManager: pnpm
packageManagerVersion: ${{ steps.versions.outputs.pnpm }}
workingDirectory: ./tests/graphql-over-http
- uses: JarvusInnovations/background-action@v1
with:
run: cargo run --bin conductor -- tests/graphql-over-http/config.yaml
wait-on: http-get://127.0.0.1:9000/graphql
tail: true
wait-for: 9m
log-output-if: failure
log-output: true
- uses: JarvusInnovations/background-action@v1
with:
run: cargo run --release
working-directory: tests/test-server
wait-on: http-get://127.0.0.1:4000
tail: true
wait-for: 9m
log-output-if: failure
log-output: true
- run: pnpm start
name: audit
working-directory: tests/graphql-over-http
env:
SERVER_URL: http://127.0.0.1:9000/graphql
config-json-schema:
runs-on: ubuntu-22.04
name: config-json-schema / integrity
steps:
- name: checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: setup environment
uses: ./.github/actions/setup
- name: generate config json schema
run: cargo run --bin generate-config-schema
- name: check diff
run: git diff --exit-code ./libs/config/conductor.schema.json
lint:
runs-on: ubuntu-22.04
name: rustfmt + clippy
steps:
- name: checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: setup environment
uses: ./.github/actions/setup
with:
components: rustfmt, clippy
- name: cargo fmt
run: cargo fmt --all -- --check
- uses: actions-rs/clippy-check@v1
name: cargo clippy
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
panic-free-audit:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: setup environment
uses: ./.github/actions/setup
- name: install panic free analyzer
run: cargo install panic-analyzer
- name: run panic free analyzer
run: cargo panic-analyzer > ./panic-audit.md
env:
IGNORED_CRATES: smoke_tests,e2e_tests,benches,server
IGNORED_FILES: ./plugins/jwt_auth/src/test.rs
- name: comment on pull request
uses: thollander/actions-comment-pull-request@v2
if: ${{ github.event_name == 'pull_request' }}
with:
filePath: ./panic-audit.md
comment_tag: rust-code-audit