30 Commits

Author SHA1 Message Date
13d7fce0be Revert "var for images"
All checks were successful
checks / lint (pull_request) Successful in 4s
checks / build (pull_request) Successful in 2m11s
checks / test (pull_request) Successful in 2m2s
This reverts commit 0c3ecb2730.
2023-10-21 14:14:27 -07:00
0c3ecb2730 var for images 2023-10-21 14:14:01 -07:00
3cad519f00 more concise
All checks were successful
checks / lint (pull_request) Successful in 4s
checks / build (pull_request) Successful in 2m13s
checks / test (pull_request) Successful in 2m0s
2023-10-21 14:12:12 -07:00
f9417f49de Revert "more concise"
This reverts commit a0e6005acd.
2023-10-21 14:11:49 -07:00
a0e6005acd more concise 2023-10-21 14:10:44 -07:00
06708f6038 re-merge file
All checks were successful
checks / lint (pull_request) Successful in 5s
checks / build (pull_request) Successful in 2m16s
checks / test (pull_request) Successful in 2m1s
2023-10-21 13:54:28 -07:00
79d263cbb7 only run on some path changes
All checks were successful
lint / lint (pull_request) Successful in 4s
checks / build (pull_request) Successful in 2m10s
checks / test (pull_request) Successful in 1m58s
2023-10-21 13:50:21 -07:00
cf0d51fca5 remove runner tag
All checks were successful
checks / lint (pull_request) Successful in 5s
checks / build (pull_request) Successful in 2m12s
checks / test (pull_request) Successful in 2m2s
2023-10-21 13:41:29 -07:00
7682dc022c try removing runner tag
All checks were successful
checks / lint (pull_request) Successful in 4s
checks / build (pull_request) Successful in 2m9s
checks / test (pull_request) Successful in 2m0s
2023-10-21 13:40:00 -07:00
763ebea60a change triggers
All checks were successful
checks / lint (pull_request) Successful in 5s
checks / build (pull_request) Successful in 2m6s
checks / test (pull_request) Successful in 1m56s
2023-10-21 13:20:41 -07:00
3fa9d65966 change triggers
All checks were successful
checks / lint (pull_request) Successful in 5s
checks / build (pull_request) Successful in 2m6s
checks / test (pull_request) Successful in 2m3s
2023-10-21 13:17:12 -07:00
39391d17a4 reorder triggers 2023-10-21 13:15:54 -07:00
563f6dd3e4 only run for push on main, or for pr 2023-10-21 13:06:42 -07:00
c7b13c2572 image changes
All checks were successful
checks / lint (push) Successful in 5s
checks / build (push) Successful in 2m11s
checks / test (push) Successful in 2m3s
2023-10-21 12:58:19 -07:00
c287334af2 add build deps to ci docker image
Some checks reported warnings
checks / lint (push) Successful in 4s
checks / test (push) Has been cancelled
checks / build (push) Has been cancelled
2023-10-21 12:57:31 -07:00
d6dfe7e525 image changes
Some checks failed
checks / lint (push) Successful in 5s
checks / build (push) Successful in 2m12s
checks / test (push) Failing after 29s
2023-10-21 12:54:44 -07:00
668e5dbacd names and images changes
Some checks failed
checks / lint (push) Successful in 4s
checks / build (push) Failing after 27s
checks / test (push) Failing after 27s
2023-10-21 12:51:49 -07:00
3ef2eff8c3 automated build and test
Some checks failed
checks / format (push) Failing after 27s
2023-10-21 12:40:59 -07:00
e56a40a469 move some steps into the base image
All checks were successful
checks / format (push) Successful in 5s
2023-10-21 12:33:45 -07:00
f55d57c8ef fix fmt
All checks were successful
checks / format (push) Successful in 6s
2023-10-21 02:21:52 -07:00
a32e7757c5 test
Some checks failed
checks / format (push) Failing after 6s
2023-10-21 02:20:04 -07:00
2659b641ba test
Some checks failed
checks / format (push) Failing after 39s
2023-10-21 02:18:59 -07:00
8fb226fafd add node
Some checks failed
checks / format (push) Failing after 43s
checks / format (pull_request) Failing after 43s
2023-10-21 01:51:53 -07:00
9c97e00d5a add checkout
Some checks failed
checks / format (push) Failing after 8s
checks / format (pull_request) Failing after 3s
2023-10-21 01:45:53 -07:00
7e49f33b95 add debug ls
Some checks failed
checks / format (push) Failing after 2s
checks / format (pull_request) Failing after 3s
2023-10-21 01:42:24 -07:00
35bb9081ab add debug ls
Some checks failed
checks / format (push) Failing after 3s
checks / format (pull_request) Failing after 2s
2023-10-21 01:41:08 -07:00
b98fd1352a add rustfmt
Some checks failed
checks / format (push) Failing after 2s
checks / format (pull_request) Failing after 2s
2023-10-21 01:39:23 -07:00
a27214c8da Revert "test"
This reverts commit 81158ca818.
2023-10-21 01:39:23 -07:00
b53c875eac test 2023-10-21 01:39:23 -07:00
0e92eda123 add automated format check 2023-10-21 01:39:23 -07:00
5 changed files with 52 additions and 35 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

View File

@ -1,30 +0,0 @@
# Contribution Guidelines
## Code Formatting
We format all Rust code using edition 2021 rules. This edition is defined in our Cargo.toml and most methods below will pick this up automatically.
### Manual Method
The most editor agnostic way to format your Rust code is by manually running cargo's fmt sub command.
To check if your code is formatted without making changes, run `cargo fmt --check`. Then if you want to format your code you can run just `cargo fmt`.
### VScode
We recommend the meta extension [Rust Bundle](https://marketplace.visualstudio.com/items?itemName=1YiB.rust-bundle) , which includes rust-analyzer. ([More info](https://code.visualstudio.com/docs/languages/rust) on Rust with VScode) Then to set your editor to format on save:
* In Visual Studio Code, press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type setting and then select Preferences: Open User Settings option.
* Search for format on save setting and check the checkbox.
You can also set language specific settings as outlined [here](https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings). You will again want to then search for format on save and check the checkbox.
### Other Editors
You will first need to [install rust-analyzer](https://rust-analyzer.github.io/manual.html#installation), then configure your editor and install any needed plugins or extensions as outlined on that page.
### Pre Commit Hook
If you want to think about formatting your code less and just have git yell at you whe you try to commit code that is not properly formatted, you can use a simple pre-commit hook.
After cloning the repo, move the file `pre-commit` to `.git/hooks/pre-commit`. That's it.

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

@ -1,3 +0,0 @@
#!/bin/bash
cargo fmt --check

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;
}