Run CI on a stock image, installing Trunk by hand
Instead of building a custom CI image with Trunk pre-installed, let's try running CI on a stock image, installing Trunk from a binary on every workflow run.
This commit is contained in:
parent
f212cfadf4
commit
4251242953
3 changed files with 18 additions and 19 deletions
14
.forgejo/setup-trunk/action.yaml
Normal file
14
.forgejo/setup-trunk/action.yaml
Normal 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:
|
||||
- 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
|
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Add table
Reference in a new issue