Fix build, Update dependencies #616
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup set profile default | |
rustup show | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install pre-commit | |
run: | | |
pip install pre-commit | |
pre-commit install --config .pre-commit-config.actions.yaml | |
- name: pre-commit | |
run: | | |
pre-commit run --config .pre-commit-config.actions.yaml --all-files --show-diff-on-failure | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup set profile default | |
rustup show | |
- run: cargo fetch --verbose | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features -- -D warnings | |
test: | |
runs-on: ${{ matrix.os.long }} | |
strategy: | |
matrix: | |
os: | |
- long: ubuntu-latest | |
short: linux | |
- long: macOS-latest | |
short: mac | |
- long: windows-latest | |
short: win | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup set profile minimal | |
rustup show | |
- run: cargo fetch --verbose | |
- run: cargo build --tests | |
- name: cargo test | |
run: | | |
# TODO: Temporarily fix default branch name to old name to fix failing macOS test | |
git config --global init.defaultbranch master | |
cargo test --all | |
shell: bash | |
env: | |
RUST_LOG: trace | |
RUST_BACKTRACE: 1 | |
build: | |
runs-on: ${{ matrix.os.long }} | |
strategy: | |
matrix: | |
os: | |
- long: ubuntu-latest | |
short: linux | |
- long: macOS-latest | |
short: mac | |
- long: windows-latest | |
short: win | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup set profile minimal | |
rustup show | |
- run: cargo fetch --verbose | |
- run: cargo check | |
env: | |
RUSTFLAGS: -D warnings | |
- run: cargo build | |
- name: Archive | |
shell: bash | |
working-directory: target/debug | |
run: | | |
VERSION=$(./git-trim --version | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
rm -rf artifacts | |
mkdir -p artifacts | |
cp 'git-trim' artifacts/ | |
echo '${{github.sha}} ${{github.ref}}' | tee artifacts/git-ref | |
if command -v sha256sum; then | |
sha256sum 'git-trim' | tee artifacts/sha256sums | |
else | |
shasum -a 256 'git-trim' | tee artifacts/sha256sums | |
fi | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: git-trim-${{matrix.os.short}}-${{env.VERSION}} | |
path: target/debug/artifacts/ | |
docs-are-up-to-date: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup set profile minimal | |
rustup show | |
- run: cargo fetch --verbose | |
- run: ./build-man.sh build | |
- run: ./build-man.sh run | |
- name: Check docs are up-to-date | |
run: git diff --exit-code HEAD -- docs |