Add unified SQL catalog managers (SQLite + Postgres) (#33) #30
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: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "LICENSE" | |
| - ".gitignore" | |
| - "docs/**" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**.md" | |
| - "LICENSE" | |
| - ".gitignore" | |
| - "docs/**" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-C debuginfo=0" | |
| RUSTC_WRAPPER: sccache | |
| jobs: | |
| fmt: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| cache: false | |
| - run: cargo fmt --all -- --check | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mozilla-actions/[email protected] | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| cache: false | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - run: cargo check --all-targets | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mozilla-actions/[email protected] | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| cache: false | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - run: cargo clippy --all-targets --no-deps -- -D warnings | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mozilla-actions/[email protected] | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| cache: false | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Cache target dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: target/ | |
| key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/*.rs') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}- | |
| ${{ runner.os }}-cargo-target- | |
| - run: cargo test | |
| build: | |
| name: Build (${{ matrix.arch }}) | |
| needs: [test] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' # only build on main (for now) | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mozilla-actions/[email protected] | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| cache: false | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: ${{ runner.os }}-${{ matrix.arch }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.arch }}-cargo-registry- | |
| - name: Build release binary | |
| run: cargo build --release --bin server | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| run: | | |
| docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.arch }} . | |
| docker push ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.arch }} | |
| manifest: | |
| name: Create multi-arch manifest | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| docker manifest create ghcr.io/${{ github.repository }}:${{ github.sha }} \ | |
| ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \ | |
| ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64 | |
| docker manifest push ghcr.io/${{ github.repository }}:${{ github.sha }} | |
| docker manifest create ghcr.io/${{ github.repository }}:latest \ | |
| ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \ | |
| ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64 | |
| docker manifest push ghcr.io/${{ github.repository }}:latest |