git-mob/.github/workflows/ci.yml

51 lines
1.4 KiB
YAML

on: push
name: CI
jobs:
lint_and_test:
name: lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- uses: actions-rs/clippy-check@v1
if: ${{ github.actor != 'dependabot[bot]' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings
- run: cargo check --workspace --all-features
- run: cargo test --all-targets
- run: cargo fmt --all -- --check
build_package:
needs: lint_and_test
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/build-') }}
name: Build package
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo install mdsh mandown
- run: cargo build --release
- run: ./build-manpages.sh
- uses: actions/upload-artifact@v2
with:
name: git-mob-${{ matrix.os }}
path: |
target/release/git-*
target/man
!target/release/*.d