Skip to content

Commit

Permalink
Update outdated test.yml Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Jun 19, 2023
1 parent 9ba3401 commit e717d6b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 75 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/publish.yml

This file was deleted.

94 changes: 69 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@ on:
- pull_request

jobs:

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check code format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -15,45 +35,69 @@ jobs:
- nightly
steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Setup Rust ${{ matrix.rust-toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust-toolchain }}
override: true
- name: Setup cache for cargo
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-${{ matrix.rust-toolchain }}
- name: Check code
uses: actions-rs/cargo@v1
with:
command: check
- name: Measure code coverage
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.16.0'
args: '--lib -v --out Xml --ciserver github-actions'
- name: Upload coverage statistics
run: curl -SsL "https://codecov.io/bash" | bash -s
version: '0.19.0'
args: '-v --out Xml --ciserver github-actions'
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.rust-toolchain }}
name: test-${{ matrix.rust-toolchain }}
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
codecov_curl_args: "--globoff"
verbose: true

publish:
needs: test
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/v')"
environment: Crates.io
name: Publish crates
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust ${{ matrix.rust-toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Package and publish crate
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_IO_TOKEN }}

lint:
release:
needs: publish
environment: GitHub Releases
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/v')"
name: Release
permissions:
contents: write
pull-requests: read
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check code format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Checkout code
uses: actions/checkout@v3
- name: Release a Changelog
uses: rasmus-saks/release-a-changelog-action@v1.0.1
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'



24 changes: 0 additions & 24 deletions .github/workflows/update-releases.yml

This file was deleted.

0 comments on commit e717d6b

Please sign in to comment.