From f528650fb3d447af402b82375e996958837ef296 Mon Sep 17 00:00:00 2001 From: Marc Plano-Lesay Date: Fri, 1 Aug 2025 11:55:52 +1000 Subject: [PATCH] chore: migrate CI to Forgejo --- .../workflows/renovate-config-validation.yaml | 15 ++ .forgejo/workflows/rust.yml | 149 ++++++++++++++++++ .forgejo/workflows/yamllint.yaml | 18 +++ .gitlab-ci.yml | 62 -------- .yamllint.yaml | 30 ++++ renovate.json | 7 + 6 files changed, 219 insertions(+), 62 deletions(-) create mode 100644 .forgejo/workflows/renovate-config-validation.yaml create mode 100644 .forgejo/workflows/rust.yml create mode 100644 .forgejo/workflows/yamllint.yaml delete mode 100644 .gitlab-ci.yml create mode 100644 .yamllint.yaml create mode 100644 renovate.json diff --git a/.forgejo/workflows/renovate-config-validation.yaml b/.forgejo/workflows/renovate-config-validation.yaml new file mode 100644 index 0000000..bb1dce6 --- /dev/null +++ b/.forgejo/workflows/renovate-config-validation.yaml @@ -0,0 +1,15 @@ +--- +name: Checking Renovate configuration + +on: # yamllint disable-line rule:truthy + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Validate Renovate configuration + uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.1.1 +... diff --git a/.forgejo/workflows/rust.yml b/.forgejo/workflows/rust.yml new file mode 100644 index 0000000..a7e2fb6 --- /dev/null +++ b/.forgejo/workflows/rust.yml @@ -0,0 +1,149 @@ +--- +# 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 +... diff --git a/.forgejo/workflows/yamllint.yaml b/.forgejo/workflows/yamllint.yaml new file mode 100644 index 0000000..1b5cb26 --- /dev/null +++ b/.forgejo/workflows/yamllint.yaml @@ -0,0 +1,18 @@ +--- +name: Checking yaml + +on: # yamllint disable-line rule:truthy + pull_request: + +jobs: + yamllint: + name: Run yamllint + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Run YAML linter + uses: bewuethr/yamllint-action@v1 + with: + config-file: .yamllint.yaml +... diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 907e60d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -stages: - - test - - build - - publish - - -default: - -tests: - stage: test - image: rust - before_script: - - rustc --version - - cargo --version - - rustup component add rustfmt - script: - - cargo fmt --check - - cargo test - -build:amd64: - stage: build - image: rust - before_script: - - rustc --version - - cargo --version - script: - - cargo build --release - artifacts: - paths: - - target/release/immich-tools - -rustdoc: - stage: build - image: rust - before_script: - - rustc --version - - cargo --version - script: - - cargo doc - artifacts: - paths: - - target/doc - -pages: - stage: publish - image: alpine - dependencies: - - build:amd64 - - rustdoc - script: - - mkdir -p public - - mv target/doc public/doc - - mv target/release/immich-tools public/immich-tools-amd64 - artifacts: - paths: - - public - only: - - main -... - - diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..79bc82f --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,30 @@ +--- +ignore: | + .platformio + secrets.yaml + +rules: + braces: enable + brackets: enable + colons: enable + commas: enable + comments: enable + comments-indentation: enable + document-end: enable + document-start: enable + empty-lines: + max: 1 + empty-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: + max: 100 + new-line-at-end-of-file: enable + new-lines: enable + octal-values: enable + quoted-strings: disable + trailing-spaces: enable + truthy: enable +... diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..aa41364 --- /dev/null +++ b/renovate.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "assignees": ["kernald"], + "extends": [ + "config:recommended" + ] +}