chore(lint): fix format #272
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: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Initialize git config for testing | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "mr fake" | |
- name: Install and initialize sapling on macos | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install sapling | |
sl config --user ui.username "mr fake <[email protected]>" | |
- name: Run cargo test | |
uses: nick-fields/[email protected] | |
env: | |
TMPDIR: ${{ runner.temp }} | |
with: | |
timeout_minutes: 10 | |
max_attempts: 10 | |
retry_wait_seconds: 90 | |
command: | | |
cargo test | |
linux: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: messense/maturin-action@v1 | |
with: | |
manylinux: auto | |
command: build | |
args: --release -o target/dist | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: target/dist | |
windows: | |
runs-on: windows-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: messense/maturin-action@v1 | |
with: | |
command: build | |
args: --release --no-sdist -o dist | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
runs-on: macos-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: messense/maturin-action@v1 | |
with: | |
command: build | |
args: --release --no-sdist -o dist --universal2 | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: [ macos, windows, linux, test ] | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: messense/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * |