rathole/.github/workflows/rust.yml

61 lines
1.6 KiB
YAML
Raw Normal View History

2021-12-19 08:35:43 +01:00
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
2022-01-02 07:53:15 +01:00
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: rathole
asset_name: rathole-linux-amd64
- os: windows-latest
artifact_name: rathole.exe
asset_name: rathole-windows-amd64.exe
- os: macos-latest
artifact_name: rathole
asset_name: rathole-macos-amd64
2021-12-19 08:35:43 +01:00
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v1
- name: Clippy
run: cargo clippy -- -D warnings
2021-12-19 08:35:43 +01:00
- name: Build
run: cargo build --verbose
- name: Setup cargo-hack
run: cargo install cargo-hack
2021-12-20 05:42:54 +01:00
- name: Build with features
run: cargo hack check --feature-powerset --no-dev-deps
2021-12-19 08:35:43 +01:00
- name: Run tests
run: cargo test --verbose
2022-01-02 07:53:15 +01:00
- name: Build release
run: cargo build --release
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.asset_name }}
path: target/release/${{ matrix.artifact_name }}
- name: Release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}