Run continuous integration on a custom image
Write a Dockerfile that describes a Debian image with our build environment set up in it. Write a script that builds and tags the custom image. Set the continuous integration workflow to run on the custom image, pulled from Docker's local image store. Running the examples on the custom image takes the same steps as running them on a development machine, so we no longer gain anything from factoring out the `cargo run --example` steps. That means we can get rid of the `run-examples` action. Since the build environment is now set up ahead of time, we can get rid of the `setup-rust` action too.
This commit is contained in:
parent
bbfdf2b87f
commit
4442dd860b
5 changed files with 40 additions and 30 deletions
|
@ -3,23 +3,46 @@ on:
|
|||
push:
|
||||
branches: [main]
|
||||
jobs:
|
||||
# build the application, reporting success if the build completes
|
||||
build:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: dyna3:ci
|
||||
defaults:
|
||||
run:
|
||||
working-directory: app-proto
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||
- uses: ./.forgejo/setup-rust
|
||||
- run: rustup target add wasm32-unknown-unknown
|
||||
- run: cargo install trunk
|
||||
- run: cd app-proto; trunk build
|
||||
- run: trunk build
|
||||
|
||||
# run the automated tests, reporting success if the tests pass
|
||||
test:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: dyna3:ci
|
||||
defaults:
|
||||
run:
|
||||
working-directory: app-proto
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||
- uses: ./.forgejo/setup-rust
|
||||
- run: cd app-proto; cargo test
|
||||
- run: cargo test
|
||||
|
||||
# run the Cargo examples, as described here:
|
||||
#
|
||||
# Karol Kuczmarski. "Add examples to your Rust libraries"
|
||||
# http://xion.io/post/code/rust-examples.html
|
||||
#
|
||||
# report success if the examples build and run without errors
|
||||
run-examples:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: dyna3:ci
|
||||
defaults:
|
||||
run:
|
||||
working-directory: app-proto
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||
- uses: ./.forgejo/setup-rust
|
||||
- uses: ./.forgejo/run-examples
|
||||
- run: cargo run --example irisawa-hexlet
|
||||
- run: cargo run --example three-spheres
|
||||
- run: cargo run --example point-on-sphere
|
||||
- run: cargo run --example kaleidocycle
|
Loading…
Add table
Add a link
Reference in a new issue