Skip to content

chore: check for compilation warnings in CI (#236) #126

chore: check for compilation warnings in CI (#236)

chore: check for compilation warnings in CI (#236) #126

Workflow file for this run

---
name: CI on Master
on:
push:
branches:
- master
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: run cargo test
run: cargo test --all-features
coverage:
name: Code Coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.28.0
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v4
- name: Generate code coverage
run: |
cargo tarpaulin --verbose --timeout 120
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
get-next-version:
name: Get the next version
runs-on: ubuntu-latest
outputs:
version : ${{ steps.semantic-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: paulhatch/semantic-version@c423ebb78413907bc5382d5a0e840be160a83981
id: semantic-version
with:
tag_prefix: "v"
major_pattern: "/breaking change:/"
major_regexp_flags: "ig"
minor_pattern: "/^feat:/"
minor_regexp_flags: "ig"
version_format: "${major}.${minor}.${patch}"
bump_each_commit: false
search_commit_body: true
enable_prerelease_mode: true
release:
name: Publish a new release
needs:
- get-next-version
- test
- coverage
permissions:
# This permission is required in order to push the new
# tag to the repository.
contents: write
runs-on: ubuntu-latest
env:
next-version: ${{ needs.get-next-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Print the next version
run: |
echo "The next version is ${{ env.next-version }}"
- name: Patch the Cargo version
run: |
sed -i 's/0.0.0-placeholder-version/${{ env.next-version }}/' Cargo.toml
git diff
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Publish new Cargo version
env:
# This token needs to be created with the publish-update scope.
# The other scopes are not necessary.
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --allow-dirty
- name: Tag the next version
run: |
new_tag_name="v${{ env.next-version }}"
git tag "$new_tag_name" "${{ github.sha }}"
git push origin "$new_tag_name"