From 1d03fbfb06780fb44e4c884345b68c1165763dc3 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 7 Apr 2024 16:03:28 +0100 Subject: [PATCH] build(woodpecker): Add initial CI --- .woodpecker/build.yml | 38 ++++++++++++++++++++++++++++++++++++++ .woodpecker/docker.yml | 21 +++++++++++++++++++++ .woodpecker/release.yml | 13 +++++++++++++ .woodpecker/todo-check.yml | 12 ++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 .woodpecker/build.yml create mode 100644 .woodpecker/docker.yml create mode 100644 .woodpecker/release.yml create mode 100644 .woodpecker/todo-check.yml diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml new file mode 100644 index 0000000..33a36b1 --- /dev/null +++ b/.woodpecker/build.yml @@ -0,0 +1,38 @@ +steps: + update-builder-image: + when: + - event: cron + image: docker.io/woodpeckerci/plugin-docker-buildx:latest + settings: + username: kemitix + repo: git.kemitix.net/kemitix/git-next-builder + auto_tag: true + dockerfile: Dockerfile.builder + dry-run: false # push to remote repo + registry: git.kemitix.net + password: + from_secret: woodpecker-docker-push + build: + image: git.kemitix.net/kemitix/git-next-builder:latest + environment: + CARGO_TERM_COLOR: always + lint: + image: git.kemitix.net/kemitix/git-next-builder:latest + environment: + CARGO_TERM_COLOR: always + commands: + - ls -l /usr/local/cargo/bin/ + - cargo fmt --all -- --check + - cargo clippy -- -D warnings -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used + when: + - event: pull_request + - event: cron + test: + image: git.kemitix.net/kemitix/git-next-builder:latest + environment: + CARGO_TERM_COLOR: always + commands: + - cargo test + when: + - event: pull_request + - event: cron diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yml new file mode 100644 index 0000000..4dbf3f8 --- /dev/null +++ b/.woodpecker/docker.yml @@ -0,0 +1,21 @@ +# INFO: https://woodpecker-ci.org/plugins/Docker%20Buildx +steps: + docker-build: + image: docker.io/woodpeckerci/plugin-docker-buildx:3.2.1 + settings: + username: kemitix + repo: git.kemitix.net/kemitix/git-next + dockerfile: Dockerfile + build_args: + - CARGO_PROFILE=release + - CARGO_TARGET=release + auto_tag: true + dry-run: false # push to remote repo + registry: git.kemitix.net + password: + from_secret: woodpecker-docker-push + when: + - event: push + branch: main + - event: tag + ref: refs/tags/v* diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml new file mode 100644 index 0000000..6161892 --- /dev/null +++ b/.woodpecker/release.yml @@ -0,0 +1,13 @@ +# INFO: https://woodpecker-ci.org/plugins/Gitea%20Release +steps: + publish: + image: docker.io/woodpeckerci/plugin-gitea-release:0.3.1@sha256:ec26c974254a7524310ffcdb0e46f9141988b4e239cbb812a341b781f10e7cbd + settings: + base_url: https://git.kemitix.net + api_key: + from_secret: FORGEJO_RELEASE_PLUGIN + target: main + prerelease: true + when: + - event: tag + ref: refs/tags/v* diff --git a/.woodpecker/todo-check.yml b/.woodpecker/todo-check.yml new file mode 100644 index 0000000..aa42754 --- /dev/null +++ b/.woodpecker/todo-check.yml @@ -0,0 +1,12 @@ +# INFO: https://woodpecker-ci.org/plugins/TODO-Checker +steps: + todo_check: + image: codeberg.org/epsilon_02/todo-checker:1.1.1@sha256:58ebb185706a56147b588be612aa16579c007fa6213a5b46ae01b4e0341dd946 + settings: + # git-next-woodpecker-todo-checker - read:issue + repository_token: '776a3b928b852472c2af727a360c85c00af64b9f' + prefix_regex: "(#|//) (TODO|FIXME): " + debug: false + when: + - event: pull_request + - event: cron