diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..e6712d8 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,31 @@ +name: Ruff Format Check + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + format: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff + + - name: Check formatting with ruff + run: | + ruff format --check . diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..924c3d3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Ruff Lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff + + - name: Lint with ruff + run: | + ruff check . diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 72% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index ec324c5..d946206 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: RivRetrieve CI +name: Python Tests on: push: @@ -7,7 +7,7 @@ on: branches: [ main ] jobs: - build: + test: runs-on: ubuntu-latest strategy: matrix: @@ -25,15 +25,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install ruff - - - name: Lint with ruff (includes import sorting) - run: | - ruff check . - - - name: Check formatting with ruff - run: | - ruff format --check . - name: Test with unittest run: |