WIP: automated-testing #9
|
@ -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
|
|
@ -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
|
|
@ -2,8 +2,7 @@ use warp::Filter;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let hello = warp::get()
|
let hello = warp::get().map(|| format!("Hello world!"));
|
||||||
.map(|| format!("Hello world!"));
|
|
||||||
|
|
||||||
warp::serve(hello).run(([127, 0, 0, 1], 5309)).await;
|
warp::serve(hello).run(([127, 0, 0, 1], 5309)).await;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue