add initial rama cli #1146
Workflow file for this run
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
name: CI | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_TOOLCHAIN: stable | |
RUST_TOOLCHAIN_NIGHTLY: nightly | |
RUST_TOOLCHAIN_MSRV: 1.75.0 | |
RUST_TOOLCHAIN_BETA: beta | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
jobs: | |
check-msrv: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: check | |
run: | | |
cargo check --all --all-targets --all-features | |
- name: clippy | |
run: | | |
cargo clippy --all --all-targets --all-features | |
- name: rustfmt | |
run: | | |
cargo fmt --all -- --check | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: check | |
run: | | |
cargo check --all --all-targets --all-features | |
- name: clippy | |
run: | | |
cargo clippy --all --all-targets --all-features | |
- name: rustfmt | |
run: | | |
cargo fmt --all -- --check | |
check-docs: | |
runs-on: ubuntu-latest | |
needs: [check, check-msrv] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: cargo doc | |
env: | |
RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links" | |
run: cargo doc --all-features --no-deps --workspace | |
test-msrv: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-beta: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_BETA}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-windows-msrv: | |
needs: [check, check-msrv] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-windows-beta: | |
needs: [check, check-msrv] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_BETA}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-windows: | |
needs: [check, check-msrv] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-macos-msrv: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-macos-beta: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-macos: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace | |
test-ignored-msrv: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace -- --ignored | |
test-ignored-beta: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_BETA}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace -- --ignored | |
test-ignored: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace -- --ignored | |
test-ignored-macos-msrv: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace -- --ignored | |
test-ignored-macos-beta: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace -- --ignored | |
test-ignored-macos: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test --all-features --workspace -- --ignored | |
test-docs: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --doc --all-features --workspace | |
test-examples-beta: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_BETA}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-msrv: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-windows-beta: | |
needs: [check, check-msrv] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_BETA}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-windows-msrv: | |
needs: [check, check-msrv] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-windows: | |
needs: [check, check-msrv] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-macos-beta: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_BETA}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-macos-msrv: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_MSRV}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
test-examples-macos: | |
needs: [check, check-msrv] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run doc tests | |
run: cargo test --all-features --examples --workspace | |
cargo-hack: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- name: install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: cargo hack check | |
run: cargo hack check --each-feature --no-dev-deps --workspace | |
dependencies-are-sorted: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN}} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-sort | |
run: | | |
cargo install cargo-sort | |
- name: Check dependency tables | |
working-directory: . | |
run: | | |
cargo sort --workspace --grouped --check | |
cargo-deny: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
cargo-fuzz: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: ${{env.RUST_TOOLCHAIN_NIGHTLY}} | |
- name: Install cargo-fuzz | |
run: | | |
cargo install cargo-fuzz | |
- name: cargo fuzz check | |
run: | | |
cargo +nightly fuzz run ua_parse -- -max_len=131072 -max_total_time=30 | |
semver-checks: | |
needs: [check, check-msrv] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check semver | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | |
with: | |
rust-toolchain: ${{env.RUST_TOOLCHAIN}} | |
deploy-rama-fp-docker: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- test-examples | |
- test-msrv | |
- test-beta | |
- test-examples-msrv | |
- test-examples-beta | |
- test-ignored | |
- test-ignored-msrv | |
- test-ignored-beta | |
- test-docs | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: glendc/rama-fp:latest | |
file: rama-fp/infra/Dockerfile | |
deploy-rama-fp-fly: | |
runs-on: ubuntu-latest | |
needs: deploy-rama-fp-docker | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: | | |
cd rama-fp/infra/deployments/fp | |
flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
deploy-rama-fp-h1-fly: | |
runs-on: ubuntu-latest | |
needs: deploy-rama-fp-docker | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: | | |
cd rama-fp/infra/deployments/fp-h1 | |
flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
deploy-rama-echo-fly: | |
runs-on: ubuntu-latest | |
needs: deploy-rama-fp-docker | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: | | |
cd rama-fp/infra/deployments/echo | |
flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
deploy-rama-cli-docker: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- test-examples | |
- test-msrv | |
- test-beta | |
- test-examples-msrv | |
- test-examples-beta | |
- test-ignored | |
- test-ignored-msrv | |
- test-ignored-beta | |
- test-docs | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: glendc/rama:latest | |
file: rama-cli/infra/Dockerfile |