Skip to content

Commit

Permalink
Switch from TravisCI to Github Actions (#117)
Browse files Browse the repository at this point in the history
CI is currently out of action likely because TravisCI made some changes a few years back.
Reasons to switch to Github Action instead of fixing TravisCI:
- I'm actually able to fix it this way, since I don't need to be the repository owner. A PR is enough.
- Unsure if they even still offer free CI. Github Actions is free, reliable and well itegrated
- GHA is the one I'm familiar with.

Test are run on Linux, Windows, and macOS. Since the Unix test require a tty, which isn't available
on the GHA runners, they are run under faketty. Unfortunately that in turn requires a fairly recent
Rust version to compile and binary artifacts aren't available, so Unix systems with MSRV only run
build tests.
Examples are build-tested only. Formatting is also checked.
  • Loading branch information
LingMan committed Feb 8, 2023
1 parent 5a44857 commit 7349042
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 20 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
pull_request:
push:

jobs:
test:
name: Test
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
rust: ["stable", "1.58"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build
run: cargo build
- name: Build examples
run: cargo build --examples
- name: Install faketty
if: matrix.rust == 'stable' && matrix.os != 'windows-latest'
run: |
cargo install faketty
echo "fake_tty=faketty" >> $GITHUB_ENV
- name: Test
if: env.fake_tty || matrix.os == 'windows-latest'
run: ${{ env.fake_tty }} cargo test --workspace

fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run rustfmt check
run: cargo fmt --check
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
description = "Console progress bar for Rust"
documentation = "https://a8m.github.io/pb/doc/pbr/index.html"
repository = "https://github.com/a8m/pb"
exclude = ["gif/", ".travis.yml"]
exclude = ["gif/"]
keywords = ["cli", "progress", "terminal", "pb"]
license = "MIT"

Expand Down

0 comments on commit 7349042

Please sign in to comment.