Set up continuous integration in Forgejo #75

Merged
glen merged 23 commits from Vectornaut/dyna3:forgejo-ci into main 2025-04-02 20:31:42 +00:00
3 changed files with 18 additions and 19 deletions
Showing only changes of commit 4251242953 - Show all commits

View file

@ -0,0 +1,14 @@
# set up the Trunk web build system
#
# https://trunkrs.dev
#
# the `curl` call is based on David Tolnay's `rust-toolchain` action
#
# https://github.com/dtolnay/rust-toolchain
#
runs:
using: "composite"
steps:
glen marked this conversation as resolved
Review

Reviewing this is hampered because I have no idea what using: "composite" means, and https://forgejo.org/docs/next/user/actions/ sheds no light on this. Can you either explain or point to somewhere that has the information?

Reviewing this is hampered because I have no idea what `using: "composite"` means, and https://forgejo.org/docs/next/user/actions/ sheds no light on this. Can you either explain or point to somewhere that has the information?
Review

The documentation of Gitea Actions and Forgejo Actions seems to rely a lot on the principle that these are "similar and mostly compatible to GitHub Actions," despite Forgejo's insistence that "they are not and will never be identical." GitHub's description of composite actions is pretty much what I'd guess from the usage here:

A composite action allows you to combine multiple workflow steps within one action. For example, you can use this feature to bundle together multiple run commands into an action, and then have a workflow that executes the bundled commands as a single step using that action. To see an example, check out Creating a composite action.

The documentation of Gitea Actions and Forgejo Actions seems to rely a lot on the [principle](https://docs.gitea.com/next/usage/actions/overview#name) that these are "similar and mostly compatible to GitHub Actions," despite Forgejo's insistence that "they are not and will never be identical." GitHub's [description](https://docs.github.com/en/actions/sharing-automations/creating-actions/about-custom-actions#composite-actions) of composite actions is pretty much what I'd guess from the usage [here](https://forgejo.org/docs/next/user/actions/#inputs): > A composite action allows you to combine multiple workflow steps within one action. For example, you can use this feature to bundle together multiple run commands into an action, and then have a workflow that executes the bundled commands as a single step using that action. To see an example, check out [Creating a composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action).
- run: rustup target add wasm32-unknown-unknown
- run: curl --output - --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail 'https://github.com/trunk-rs/trunk/releases/download/v0.21.12/trunk-x86_64-unknown-linux-gnu.tar.gz' | tar --gunzip --extract --file -
working-directory: /usr/local/cargo/bin

View file

@ -3,26 +3,17 @@ on:
push:
branches: [main]
jobs:
# build and tag the Docker image that the rest of the jobs will run on
setup-image:
runs-on: self-hosted
defaults:
run:
working-directory: tools/ci-image
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- run: docker build . --tag dyna3:ci
# build the application, reporting success if there are no errors or warnings
build:
runs-on: docker
container:
image: dyna3:ci
needs: [setup-image]
image: rust:1.85-bookworm
defaults:
run:
working-directory: app-proto
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: ./.forgejo/setup-trunk
- run: RUSTFLAGS='-D warnings' trunk build
# run the automated tests, reporting success if the tests pass and were built
@ -30,8 +21,7 @@ jobs:
test:
runs-on: docker
container:
image: dyna3:ci
needs: [setup-image]
image: rust:1.85-bookworm
defaults:
run:
working-directory: app-proto
@ -48,8 +38,7 @@ jobs:
run-examples:
runs-on: docker
container:
image: dyna3:ci
needs: [setup-image]
image: rust:1.85-bookworm
defaults:
run:
working-directory: app-proto

View file

@ -1,4 +0,0 @@
FROM rust:1.85-slim-bookworm
RUN rustup target add wasm32-unknown-unknown
RUN cargo install trunk --jobs 1
WORKDIR /home