docs: Fix readme typo #774
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
name: Rust | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ master ] | |
jobs: | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install fmt with stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt | |
override: true | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
clippy: | |
name: Clipply | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install clippy with stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
override: true | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --locked --all-targets --all-features | |
min_version: | |
name: Minimum supported rust version | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Extract min supported rust version | |
shell: bash | |
run: | | |
echo "MIN_SUPPORTED_RUST_VERSION=$(sed -n 's/^rust-version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
- name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }}) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }} | |
default: true | |
components: clippy | |
profile: minimal | |
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix) | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --locked --all-targets --all-features | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --locked | |
- name: Run examples | |
run: | | |
cp target/debug/rash /usr/local/bin/rash | |
make test-examples | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { os: ubuntu-20.04, target: arm-unknown-linux-gnueabihf, use-cross: true } | |
- { os: ubuntu-20.04, target: aarch64-unknown-linux-gnu, use-cross: true } | |
- { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, use-cross: true } | |
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, container: quay.io/pypa/manylinux2014_x86_64} | |
- { os: macos-10.15, target: x86_64-apple-darwin} | |
name: (${{ matrix.job.os }}) ${{ matrix.job.target }} | |
runs-on: ${{ matrix.job.os }} | |
# Use a container with GLIBC 2.17, make build compatible until that version | |
container: ${{ matrix.job.container }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Install prerequisites | |
shell: bash | |
run: | | |
case ${{ matrix.job.target }} in | |
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;; | |
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;; | |
esac | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
# not reuse cache between different targets: | |
# https://github.com/cross-rs/cross/issues/39#issuecomment-270684223 | |
key: ${{ matrix.job.target }} | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.job.target }} | |
override: true | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.job.use-cross }} | |
command: test | |
args: --locked --target=${{ matrix.job.target }} | |
- name: Extract crate information | |
shell: bash | |
run: | | |
echo "PROJECT_NAME=rash" >> $GITHUB_ENV | |
echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
- name: Make release | |
id: package | |
shell: bash | |
run: | | |
export CARGO_TARGET=${{ matrix.job.target }} | |
export CARGO_USE_CROSS=${{ matrix.job.use-cross }} | |
export PKG_BASE_NAME=${PROJECT_NAME}-${PROJECT_VERSION}-${CARGO_TARGET} | |
make release | |
echo "::set-output name=PKG_BASE_NAME::${PKG_BASE_NAME}" | |
- name: Publish crates | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
shell: bash | |
run: | | |
cargo login "${CRATES_IO_TOKEN}" | |
make publish | |
- name: Get Changelog Entry | |
if: startsWith(github.ref, 'refs/tags/') | |
id: changelog_reader | |
uses: mindsers/[email protected] | |
with: | |
version: v${{ env.PROJECT_VERSION }} | |
path: ./CHANGELOG.md | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} | |
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} | |
files: | | |
${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |