Add registry-watcher image and separate docker-compose services #7232
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| env: | |
| RUST_BACKTRACE: 1 | |
| RUST_CACHE_KEY: rust-cache-20241114 | |
| DOCSRS_PREFIX: ignored/cratesfyi-prefix | |
| DOCSRS_DATABASE_URL: postgresql://cratesfyi:password@localhost:15432 | |
| DOCSRS_LOG: docs_rs=debug,rustwide=info | |
| AWS_ACCESS_KEY_ID: cratesfyi | |
| AWS_SECRET_ACCESS_KEY: secret_key | |
| S3_ENDPOINT: http://localhost:9000 | |
| DOCSRS_INCLUDE_DEFAULT_TARGETS: false | |
| DOCSRS_DOCKER_IMAGE: ghcr.io/rust-lang/crates-build-env/linux-micro | |
| SENTRY_ENVIRONMENT: dev | |
| jobs: | |
| sqlx: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # We check that all github actions workflows have valid syntax | |
| - name: Validate YAML file | |
| uses: raven-actions/actionlint@v2 | |
| with: | |
| files: .github/workflow/* | |
| flags: "-ignore SC2086" # ignore some shellcheck errors | |
| - name: install `just` | |
| run: sudo snap install --edge --classic just | |
| - uses: cargo-bins/cargo-binstall@main | |
| - name: restore build & cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: ${{ env.RUST_CACHE_KEY }} | |
| - name: Launch postgres | |
| run: just ensure_db_and_s3_are_running | |
| - name: install SQLX CLI | |
| run: cargo binstall sqlx-cli --no-default-features --features postgres | |
| - name: run database migrations | |
| run: cargo sqlx migrate run --database-url $DOCSRS_DATABASE_URL | |
| - name: run sqlx prepare --check | |
| run: just sqlx-prepare | |
| - name: test reverse migrations | |
| run: | | |
| # --target 0 means "revert everything" | |
| cargo sqlx migrate revert \ | |
| --database-url $DOCSRS_DATABASE_URL \ | |
| --target-version 0 | |
| - name: shut down test environment | |
| if: ${{ always() }} | |
| run: just compose-down-and-wipe | |
| test: | |
| env: | |
| SQLX_OFFLINE: 1 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: install `just` | |
| run: sudo snap install --edge --classic just | |
| - name: restore build & cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: ${{ env.RUST_CACHE_KEY }} | |
| - name: Build | |
| run: cargo build --workspace --locked | |
| - name: Launch postgres and min.io | |
| run: just ensure_db_and_s3_are_running | |
| - name: run workspace tests | |
| run: | | |
| cargo test --workspace --locked --no-fail-fast | |
| - name: run slow tests | |
| env: | |
| DOCSRS_INCLUDE_DEFAULT_TARGETS: true | |
| run: | | |
| cargo test --locked -- --ignored --test-threads=1 | |
| - name: shut down test environment | |
| if: ${{ always() }} | |
| run: just compose-down-and-wipe | |
| GUI_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: restore build & cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: ${{ env.RUST_CACHE_KEY }} | |
| - name: install `just` | |
| run: sudo snap install --edge --classic just | |
| - name: Run GUI tests | |
| run: just run-gui-tests | |
| - name: shut down test environment | |
| if: ${{ always() }} | |
| run: just compose-down-and-wipe | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: update rust toolchain | |
| run: rustup component add rustfmt | |
| - run: cargo fmt -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: update rust toolchain | |
| run: rustup component add clippy | |
| - name: install `just` | |
| run: sudo snap install --edge --classic just | |
| - name: restore build & cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| prefix-key: ${{ env.RUST_CACHE_KEY }} | |
| - run: just lint | |
| eslint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: denoland/setup-deno@v2 | |
| - name: install `just` | |
| run: sudo snap install --edge --classic just | |
| - run: just lint-js |