Skip to content

Commit

Permalink
ci: Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpovel committed Aug 8, 2023
1 parent 928a6d5 commit 52348c6
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, test and publish
name: Main

on:
push:
Expand All @@ -8,6 +8,8 @@ env:

jobs:
build-test:
name: Build and test (${{ matrix.os }})

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -20,6 +22,7 @@ jobs:
- name: Build
run: >
cargo build
--locked
--verbose
- name: Run tests (without coverage)
Expand All @@ -28,15 +31,25 @@ jobs:
cargo test
--verbose
- name: Install cargo-tarpaulin (for coverage)
# As recommened by `cargo-binstall` team:
# https://github.com/cargo-bins/cargo-binstall/tree/d5549ce99ebc82b1ceee93a41375137b7dbd1a1f#faq
uses: taiki-e/install-action@v2
if: matrix.os == 'ubuntu-latest'
with:
tool: cargo-tarpaulin
- name: Run tests (with coverage)
if: matrix.os == 'ubuntu-latest'
run: >
cargo install cargo-tarpaulin
rustup toolchain install --profile minimal nightly
&& cargo tarpaulin
--verbose
--out Xml
--engine llvm
--skip-clean
--tests
--doc
--exclude-files 'benches/*'
- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
Expand All @@ -60,5 +73,25 @@ jobs:
id: release
with:
release-type: rust
path: core
package-name: betterletters

publish:
name: Publish to crates.io

runs-on: ubuntu-latest
needs: release-please
if: needs.release-please.outputs.created

environment: crates.io

steps:
- uses: actions/checkout@v3
- uses: swatinem/rust-cache@v2

- name: Publish
# https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials
run: >
cargo publish
--verbose
--locked
--no-verify
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 52348c6

Please sign in to comment.