--- # yamllint disable rule:line-length name: Build and test on: # yamllint disable-line rule:truthy pull_request: jobs: tests: name: Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Cache Rust toolchain and dependencies uses: actions/cache@v4 with: path: | ~/.cargo ~/.rustup target key: ${{ runner.os }}-rustup-cargo-test-${{ hashFiles('rust-toolchain.toml', 'rust-toolchain') || 'stable' }} restore-keys: | ${{ runner.os }}-rustup-cargo-test- - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable components: rustfmt override: true - name: Show versions run: | rustc --version cargo --version - name: Check formatting uses: actions-rs/cargo@v1 with: command: fmt args: --check - name: Run tests uses: actions-rs/cargo@v1 with: command: test clippy: name: Clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Cache Rust toolchain and dependencies uses: actions/cache@v4 with: path: | ~/.cargo ~/.rustup target key: ${{ runner.os }}-rustup-cargo-clippy-${{ hashFiles('rust-toolchain.toml', 'rust-toolchain') || 'stable' }} restore-keys: | ${{ runner.os }}-rustup-cargo-clippy- - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable components: clippy override: true - name: Show versions run: | rustc --version cargo --version - name: Clippy check uses: actions-rs/cargo@v1 with: command: clippy args: -- -D warnings build-amd64: name: Build AMD64 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Cache Rust toolchain and dependencies uses: actions/cache@v4 with: path: | ~/.cargo ~/.rustup target key: ${{ runner.os }}-rustup-cargo-build-${{ hashFiles('rust-toolchain.toml', 'rust-toolchain') || 'stable' }} restore-keys: | ${{ runner.os }}-rustup-cargo-build- - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - name: Show versions run: | rustc --version cargo --version - name: Build release binary uses: actions-rs/cargo@v1 with: command: build args: --release --all-features - name: Upload binary artifact uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: immich-tools-linux-amd64 path: target/release/immich-tools rustdoc: name: Generate Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Cache Rust toolchain and dependencies uses: actions/cache@v4 with: path: | ~/.cargo ~/.rustup target key: ${{ runner.os }}-rustup-cargo-doc-${{ hashFiles('rust-toolchain.toml', 'rust-toolchain') || 'stable' }} restore-keys: | ${{ runner.os }}-rustup-cargo-doc- - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - name: Show versions run: | rustc --version cargo --version - name: Generate documentation uses: actions-rs/cargo@v1 with: command: doc - name: Compress documentation run: tar -czf rustdoc.tar.gz -C target doc - name: Upload documentation artifact uses: https://code.forgejo.org/forgejo/upload-artifact@v4 with: name: rustdoc path: rustdoc.tar.gz ...