Skip to content

Commit

Permalink
rework rust ci a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Dec 16, 2023
1 parent 5d94ec8 commit 9585261
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
52 changes: 47 additions & 5 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Build and upload Rust crate
on: [push, pull_request]

jobs:
build_rust:
name: Build Rust stuff and run Rust tests
check_fmt:
name: Check format
runs-on: ubuntu-latest

steps:
Expand All @@ -21,18 +21,60 @@ jobs:
- name: Check format
run: cargo fmt --check

check_clippy:
name: Check clippy
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Setup clippy
run: rustup component add clippy

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build Rust package
run: cargo build --release --workspace
run_tests:
name: Run tests
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build Rust tests
- name: Run tests
run: cargo test --workspace

publish:
name: Publish
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build Rust package
run: cargo build --release --workspace

- name: Publish dry run
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
run: cargo publish --dry-run
Expand Down
4 changes: 3 additions & 1 deletion src/rs/cickinds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ impl CICKind {
pub fn from_name(name: &str) -> Option<CICKind> {
match name {
"CIC_6101" | "6101" => Some(Self::CIC_6101),
"CIC_6102_7101" | "CIC_6102" | "CIC_7101" | "6102_7101" | "6102" | "7101" => Some(Self::CIC_6102_7101),
"CIC_6102_7101" | "CIC_6102" | "CIC_7101" | "6102_7101" | "6102" | "7101" => {
Some(Self::CIC_6102_7101)
}
"CIC_7102" | "7102" => Some(Self::CIC_7102),
"CIC_X103" | "CIC_6103" | "CIC_7103" | "X103" | "6103" | "7103" => Some(Self::CIC_X103),
"CIC_X105" | "CIC_6105" | "CIC_7105" | "X105" | "6105" | "7105" => Some(Self::CIC_X105),
Expand Down

0 comments on commit 9585261

Please sign in to comment.