WIP: automated-testing #9

Draft
cascode wants to merge 30 commits from automated-testing into main
3 changed files with 52 additions and 2 deletions

View File

@ -0,0 +1,44 @@
name: checks
on:
pull_request:
paths: &CODE_PATHS
- 'src/**'
- 'Cargo*'
push:
paths: *CODE_PATHS
branches:
- main
jobs:
# TODO(cascode) cache checkout for build and test stages?
lint:
container:
# TODO use communitymedia docker registry
image: "cascode/aural-isle-ci:0"
steps:
- uses: actions/checkout@v3
with:
github-server-url: "https://code.communitymedia.network"
- name: rustfmt
run: cargo fmt --check
build:
container:
# TODO use communitymedia docker registry
image: "cascode/aural-isle-ci:2"
steps:
- uses: actions/checkout@v3
with:
github-server-url: "https://code.communitymedia.network"
- name: build
run: cargo build
# TODO(cascode) cache builds for test stage
test:
container:
# TODO use communitymedia docker registry
image: "cascode/aural-isle-ci:2"
steps:
- uses: actions/checkout@v3
with:
github-server-url: "https://code.communitymedia.network"
- name: run unit tests
run: cargo test

7
ci/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM rust:1.73-alpine3.18
#install build tooling
RUN apk add musl-dev && rustup component add rustfmt
# install gitea act_runner dependencies
RUN apk add nodejs git

View File

@ -2,8 +2,7 @@ use warp::Filter;
#[tokio::main]
async fn main() {
let hello = warp::get()
.map(|| format!("Hello world!"));
let hello = warp::get().map(|| format!("Hello world!"));
warp::serve(hello).run(([127, 0, 0, 1], 5309)).await;
}