diff --git a/.build.yml b/.build.yml deleted file mode 100644 index da61ce0..0000000 --- a/.build.yml +++ /dev/null @@ -1,18 +0,0 @@ -image: alpine/edge -packages: -- rust -- rustfmt -- rust-clippy -- cargo -sources: -- https://git.sr.ht/~loshz/chargectl -environment: - repo: chargectl -tasks: -- lint: | - cd $repo - cargo fmt -- --check - cargo clippy --tests -- --no-deps -D warnings -- test: | - cd $repo - cargo test --no-fail-fast --all-features diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3a99e17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: ci + +on: + push: + branches: + - main + tags: + - '*' + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + # Lint code and run tests. + - run: | + cargo fmt -- --check + cargo clippy --tests -- --no-deps -D warnings + + # Run all tests. + - run: cargo test --no-fail-fast --all-features diff --git a/README.md b/README.md index 2fbf357..ee2fdad 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # chargectl -[![builds.sr.ht status](https://builds.sr.ht/~loshz/chargectl.svg)](https://builds.sr.ht/~loshz/chargectl?) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue)](LICENSE) +[![Build Status](https://github.com/loshz/chargectl/workflows/ci/badge.svg)](https://github.com/loshz/chargectl/actions) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue)](LICENSE) CLI for managing charge thresholds on modern Linux machines. Inspired by [TLP](https://linrunner.de/tlp/).