Skip to content

Commit

Permalink
chore(ci): update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ChieloNewctle committed Nov 7, 2023
1 parent 7b0c69f commit fa163f4
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ permissions:

jobs:
format:
name: Check format
name: Check Python format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
- name: Install dependencies
Expand All @@ -28,6 +30,17 @@ jobs:
- name: Black
run: black --check --diff .

rustfmt:
name: Check Rust format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: rustup update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all --check

test:
name: Run tests
runs-on: ubuntu-latest
Expand All @@ -37,6 +50,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -63,6 +78,8 @@ jobs:
target: [x86_64, aarch64, armv7]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -83,9 +100,8 @@ jobs:
shell: bash
run: |
set -e
pip install general_sam --find-links dist --force-reinstall
pip install pytest
pytest
pip install --pre "general_sam[test]" --find-links dist --force-reinstall
pytest --import-mode=importlib
- name: pytest
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' }}
uses: uraimo/[email protected]
Expand All @@ -96,11 +112,11 @@ jobs:
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip pytest
pip3 install -U pip
run: |
set -e
pip3 install general_sam --find-links dist --force-reinstall
pytest
pip3 install --pre "general_sam[test]" --find-links dist --force-reinstall
pytest --import-mode=importlib
windows:
runs-on: windows-latest
Expand All @@ -109,6 +125,8 @@ jobs:
target: [x64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -129,9 +147,8 @@ jobs:
shell: bash
run: |
set -e
pip install general_sam --find-links dist --force-reinstall
pip install pytest
pytest
pip install --pre "general_sam[test]" --find-links dist --force-reinstall
pytest --import-mode=importlib
macos:
runs-on: macos-latest
Expand All @@ -140,6 +157,8 @@ jobs:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -159,15 +178,16 @@ jobs:
shell: bash
run: |
set -e
pip install general_sam --find-links dist --force-reinstall
pip install pytest
pytest
pip install --pre "general_sam[test]" --find-links dist --force-reinstall
pytest --import-mode=importlib
sdist:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand All @@ -183,7 +203,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [test, linux, windows, macos, sdist]
needs: [test, format, rustfmt, linux, windows, macos, sdist]
permissions:
# Used to upload release artifacts
contents: write
Expand Down

0 comments on commit fa163f4

Please sign in to comment.