From 5d3611c07808b18d67df5094d61ee5ff502ad40a Mon Sep 17 00:00:00 2001 From: red Date: Sun, 25 Feb 2024 19:09:41 +0100 Subject: [PATCH] Chore: Adding GitHub action --- .github/workflows/rust.yml | 23 +++++++++++++++++++++++ CHANGELOG.md | 2 ++ Cargo.toml | 6 ++++++ 3 files changed, 31 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..a88dbcd --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,23 @@ +name: Rust build and test +on: + push: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + CLICOLOR_FORCE: 1 + +jobs: + build: + name: Build, test, and check project + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: rustup toolchain install stable --profile minimal + - uses: Swatinem/rust-cache@v2 + - name: Build + run: cargo build + - name: Check syntax + run: cargo fmt -- --check + - name: Run tests + run: cargo test diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d49fca..1633643 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Of note: ## [2015.5.3] ### Added - Using [cargo-mutants](https://github.com/sourcefrog/cargo-mutants) to check untested code. +- Adding a GitHub action. + ### Changed - All `.solve` methods return a `None` and only `main()` will be returning errors. diff --git a/Cargo.toml b/Cargo.toml index c62d391..be5d0c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "advent-rs" +path = "src/main.rs" + [lib] +name = "advent_rs" +path = "src/lib.rs" doctest = false [profile.dev]