diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..321ec2b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: Rust + +on: [pull_request] + +env: + CARGO_TERM_COLOR: always + +jobs: + ci: + name: ${{ matrix.task }} (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + task: [test, fmt, clippy] + + steps: + - uses: actions/checkout@v6 + + - name: Use stable toolchain + run: rustup default stable + + - name: Install rustfmt + if: matrix.task == 'fmt' + run: rustup component add rustfmt + + - name: Install clippy + if: matrix.task == 'clippy' + run: rustup component add clippy + + - name: Run tests + if: matrix.task == 'test' + run: cargo test + + - name: Build examples (default features) + if: matrix.task == 'test' + run: cargo build --examples + + - name: Build atdf example + if: matrix.task == 'test' + run: cargo build --example atdf_reader --features atdf + + - name: Build serialize example + if: matrix.task == 'test' + run: cargo build --example stdf_to_xlsx --features serialize + + - name: Run rustfmt + if: matrix.task == 'fmt' + run: cargo fmt --all -- --check + + - name: Run clippy + if: matrix.task == 'clippy' + run: cargo clippy -- -D warnings + + coverage: + name: Code coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Use stable toolchain + run: rustup default stable + + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin + + - name: Run cargo-tarpaulin + run: cargo tarpaulin --ignore-tests diff --git a/.github/workflows/rust_ubuntu.yml b/.github/workflows/rust_ubuntu.yml deleted file mode 100644 index 2dcb3d9..0000000 --- a/.github/workflows/rust_ubuntu.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Rust - -on: [pull_request] - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -- -D warnings - - coverage: - name: Code coverage - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - args: '--ignore-tests'