Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mothsART committed Aug 23, 2024
1 parent 2e534b6 commit 2c1638a
Showing 1 changed file with 68 additions and 22 deletions.
90 changes: 68 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,76 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:
build:
test:
name: Test
runs-on: ubuntu-latest

strategy:
matrix:
rust:
- stable
- beta

steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

publish:
if: github.repository == 'mothsart/pouf' && startsWith(github.ref, 'refs/tags/')
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Cache
uses: Swatinem/rust-cache@v1

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose ${{ matrix.features }}

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose ${{ matrix.features }}


coverage:
name: Coverage
runs-on: ubuntu-latest

steps:
- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CRATES_TOKEN }}
args: --no-verify
- name: Checkout sources
uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Cache
uses: Swatinem/rust-cache@v1

- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin

- name: Run cargo tarpaulin
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --output-dir coverage --out lcov

- name: Publish to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2c1638a

Please sign in to comment.