better handling of non existent versions #167
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
name: CI | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@1.80 | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --workspace --all-features | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@1.80 | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
components: clippy | |
toolchain: stable | |
- uses: clechasseur/rs-clippy-check@v3 | |
build: | |
name: Build library | |
runs-on: ${{ matrix.os }} | |
needs: | |
- check | |
- fmt | |
- clippy | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
artifact-name: linux | |
- os: ubuntu-latest-arm-8-cores | |
artifact-name: linux-arm64 | |
- os: [self-hosted, macos, arm64] | |
artifact-name: macos-arm64 | |
- os: macos-13 | |
artifact-name: macos | |
- os: windows-2022 | |
artifact-name: windows | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@1.80 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ join( matrix.os, '-' ) }} | |
- name: Build | |
run: cargo build --release | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: quicksync-${{ matrix.artifact-name }} | |
path: | | |
target/release/quicksync${{ matrix.os == 'windows-2022' && '.exe' || '' }} | |
if-no-files-found: error | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: | |
- check | |
- fmt | |
- clippy | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-latest | |
- ubuntu-latest-arm-8-cores | |
- macos-13 | |
- [self-hosted, macos, arm64] | |
- windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@1.80 | |
- run: cargo test | |
coverage: | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@1.80 | |
- run: cargo install cargo-tarpaulin | |
- name: Run coverage | |
run: cargo tarpaulin --exclude-files src/main.rs --out Lcov | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
name: Publish release | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts | |
- name: List artifacts | |
run: ls -R ./artifacts | |
- name: Create a draft release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true | |
prerelease: false | |
- name: Pack artifacts | |
run: > | |
mkdir ./assets; | |
for dir in ./artifacts/*/; do | |
zip -o -j -r "./assets/$(basename "$dir")-$TAG.zip" "$dir"; | |
done | |
env: | |
TAG: ${{ github.ref_name }} | |
- name: Upload Release Assets | |
run: gh release upload $TAG ./assets/*.zip | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: ${{ github.ref_name }} |