mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
chore: add tests action
This commit is contained in:
38
.github/workflows/tests.yml
vendored
Normal file
38
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Unit and style tests
|
||||||
|
|
||||||
|
concurrency: # don't run the test when there's is a newer version
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
unit-tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Test dev build
|
||||||
|
run: cargo test
|
||||||
|
|
||||||
|
- name: Test release build
|
||||||
|
run: cargo test --release
|
||||||
|
|
||||||
|
style-checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Clippy check
|
||||||
|
run: cargo clippy # -- -D
|
||||||
|
# TODO! Uncomment this when code will be alright
|
||||||
|
- name: Format check
|
||||||
|
run: cargo fmt -- --check
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
# Game of checkers online
|
# Game of checkers online
|
||||||
|
|
||||||
Currently WIP
|
Currently WIP
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
rustfmt
|
rustfmt
|
||||||
|
clippy
|
||||||
];
|
];
|
||||||
|
|
||||||
RUST_LOG = "debug";
|
RUST_LOG = "debug";
|
||||||
|
|||||||
@@ -32,9 +32,7 @@ impl Position {
|
|||||||
trace!("Adding row: {} + {} = {}", self.row, delta.row, new_row);
|
trace!("Adding row: {} + {} = {}", self.row, delta.row, new_row);
|
||||||
trace!(
|
trace!(
|
||||||
"Adding column: {} + {} = {}",
|
"Adding column: {} + {} = {}",
|
||||||
self.column,
|
self.column, delta.column, new_column
|
||||||
delta.column,
|
|
||||||
new_column
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Some(Position {
|
Some(Position {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user