From aa29a7edac4e3b39ed1a0e02d1ef3bbc5b761ddd Mon Sep 17 00:00:00 2001 From: Fadi Hanna Al-Kass Date: Mon, 30 Jun 2025 15:39:35 -0700 Subject: [PATCH 1/2] Switch CI from Travis to GitHub Actions --- .github/workflows/build.yml | 47 +++++++++++++++++-------------------- .travis.yml | 14 ----------- Cargo.toml | 2 +- README.md | 2 +- 4 files changed, 24 insertions(+), 41 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3af63ef..c1e8169 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,56 +2,53 @@ name: Rust CI on: push: - branches: - - master - - '**/*.rs' + branches: [ master ] pull_request: - branches: - - master + branches: [ master ] jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + toolchain: [stable, beta, nightly] + continue-on-error: ${{ matrix.toolchain == 'nightly' }} steps: - - name: Check out the repository - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Set up Rust - uses: actions-rs/toolchain@v1 + - uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ matrix.toolchain }} override: true + components: clippy, rustfmt - - name: Cache Cargo registry - uses: actions/cache@v3 + - uses: actions/cache@v3 with: path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-registry- + ${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry- - - name: Cache Cargo index - uses: actions/cache@v3 + - uses: actions/cache@v3 with: path: ~/.cargo/index - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-index- + ${{ runner.os }}-${{ matrix.toolchain }}-cargo-index- - - name: Cache Cargo build - uses: actions/cache@v3 + - uses: actions/cache@v3 with: path: target - key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-build- + ${{ runner.os }}-${{ matrix.toolchain }}-cargo-build- - name: Build - run: cargo build --verbose + run: cargo build --release --verbose - - name: Run tests - run: cargo test --verbose + - name: Run example tests + run: make test - name: Run Clippy run: cargo clippy -- -D warnings diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1c15489..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -sudo: required -language: rust -os: - - linux -rust: - - stable - - beta - - nightly -matrix: - allow_failures: - - rust: nightly -script: -- cargo build --release -- make test diff --git a/Cargo.toml b/Cargo.toml index bfe2e05..de3015b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ categories = ["development-tools::testing"] license = "MIT" [badges] -travis-ci = { repository = "Alkass/polish" } +github-actions = { repository = "AlKass/polish", workflow = "Rust CI" } [dependencies] chrono = "0.3.0" diff --git a/README.md b/README.md index 389fbc0..7f9a3e0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/Alkass/polish.svg?branch=master)](https://travis-ci.org/Alkass/polish) +[![Rust CI](https://github.com/AlKass/polish/actions/workflows/build.yml/badge.svg)](https://github.com/AlKass/polish/actions/workflows/build.yml) [![Crates Package Status](https://img.shields.io/crates/v/polish.svg)](https://crates.io/crates/polish) [![](https://docs.rs/polish/badge.svg)](https://docs.rs/polish) [![](https://img.shields.io/crates/d/polish.svg)](https://crates.io/crates/polish) From 760cc613af08f1f69224b6cb56b0c9ac4ce2c333 Mon Sep 17 00:00:00 2001 From: Fadi Hanna Al-Kass Date: Mon, 30 Jun 2025 15:43:55 -0700 Subject: [PATCH 2/2] Simplify CI workflow --- .github/workflows/build.yml | 57 ------------------------------------- .github/workflows/ci.yml | 25 ++++++++++++++++ README.md | 2 +- 3 files changed, 26 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index c1e8169..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Rust CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - toolchain: [stable, beta, nightly] - continue-on-error: ${{ matrix.toolchain == 'nightly' }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - components: clippy, rustfmt - - - uses: actions/cache@v3 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.toolchain }}-cargo-registry- - - - uses: actions/cache@v3 - with: - path: ~/.cargo/index - key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.toolchain }}-cargo-index- - - - uses: actions/cache@v3 - with: - path: target - key: ${{ runner.os }}-${{ matrix.toolchain }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.toolchain }}-cargo-build- - - - name: Build - run: cargo build --release --verbose - - - name: Run example tests - run: make test - - - name: Run Clippy - run: cargo clippy -- -D warnings - - - name: Run Rustfmt - run: cargo fmt -- --check diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..81f4a3d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: Rust CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: [stable, beta, nightly] + continue-on-error: ${{ matrix.toolchain == 'nightly' }} + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + - name: Build + run: cargo build --release + - name: Run example tests + run: make test diff --git a/README.md b/README.md index 7f9a3e0..5636be6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Rust CI](https://github.com/AlKass/polish/actions/workflows/build.yml/badge.svg)](https://github.com/AlKass/polish/actions/workflows/build.yml) +[![Rust CI](https://github.com/AlKass/polish/actions/workflows/ci.yml/badge.svg)](https://github.com/AlKass/polish/actions/workflows/ci.yml) [![Crates Package Status](https://img.shields.io/crates/v/polish.svg)](https://crates.io/crates/polish) [![](https://docs.rs/polish/badge.svg)](https://docs.rs/polish) [![](https://img.shields.io/crates/d/polish.svg)](https://crates.io/crates/polish)