-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
281 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: master | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
paths: | ||
- "**.rs" | ||
- .github/workflows/master.yml | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly-x86_64-unknown-linux-gnu | ||
override: true | ||
components: rustfmt, clippy | ||
- name: Set up cargo cache | ||
uses: actions/cache@v3 | ||
continue-on-error: false | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo- | ||
- name: Lint | ||
run: | | ||
cargo fmt --all -- --check | ||
cargo clippy -- -D warnings | ||
- name: Check | ||
run: cargo check | ||
- name: Run Backend Test | ||
run: cargo test -p backend | ||
- name: Run Frontend Test | ||
run: cargo test -p frontend | ||
# judger need to build plugin first(which take long time) | ||
# - name: Run Judger test | ||
# run: cd judger && just test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
/cert.pem | ||
/a.log | ||
/judger.proto | ||
/backend.proto | ||
/backend.proto | ||
/ws-Cargo.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
tonic_build::compile_protos("../proto/backend.proto")?; | ||
tonic_build::compile_protos("../proto/judger.proto")?; | ||
tonic_build::configure() | ||
.build_client(false) | ||
.type_attribute( | ||
"oj.backend.SortBy", | ||
"#[derive(serde::Serialize, serde::Deserialize)]", | ||
) | ||
.compile(&["../proto/backend.proto"], &["../proto"])?; | ||
// tonic_build::compile_protos("../proto/backend.proto")?; | ||
// tonic_build::compile_protos("../proto/judger.proto")?; | ||
tonic_build::configure() | ||
.build_server(false) | ||
.type_attribute( | ||
"oj.backend.SortBy", | ||
"#[derive(serde::Serialize, serde::Deserialize)]", | ||
) | ||
.compile(&["../proto/judger.proto"], &["../proto"])?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.