Skip to content

Commit

Permalink
update workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
bkmarzouk committed Sep 20, 2023
1 parent 1c6f66e commit 81bdbbf
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 6 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/dev_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: SOPRANO (Dev) Tests

on:
push:
branches:
- python-dev
pull_request:
branches:
- python-dev

jobs:
lint:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11"]
name: lint with python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install ruff and black
run: |
python -m pip install --upgrade pip
pip install ruff black
- name: Lint check with ruff
run: |
ruff --format=github --target-version=py311 --line-length 79 .
- name: Style check with black
run: |
black ./ --check --line-length 79
test:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11"]
name: test with python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: src/SOPRANO/local.yml
init-shell: bash
- name: Install SOPRANO
shell: bash -l {0}
run: |
micromamba activate soprano-dev
pip install -e .[ci]
- name: Test conda environment
shell: bash -l {0}
run: |
micromamba activate soprano-dev
pytest tests/test_configuration
- name: Test units
shell: bash -l {0}
run: |
micromamba activate soprano-dev
pytest tests/test_units
12 changes: 6 additions & 6 deletions .github/workflows/test.yml → .github/workflows/main_tests.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: SOPRANO Tests
name: SOPRANO (Main) Tests

on:
push:
branches:
- python-dev
- osx-actions
- python
- master
pull_request:
branches:
- python
- master

jobs:
lint:
Expand Down Expand Up @@ -36,8 +37,7 @@ jobs:
test:
strategy:
matrix:
# os: ["ubuntu-latest", "macos-latest"] # TODO: use full matrix on PR to main/python else just ubuntu
os: ["macos-latest"] # TMP Whilst testing
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.11"]
name: test with python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -62,7 +62,7 @@ jobs:
run: |
micromamba activate soprano-dev
pytest tests/test_units
# - name: Test integration
# - name: Test integration # TODO: Need to think about this
# shell: bash -l {0}
# run: |
# micromamba activate soprano-dev
Expand Down

0 comments on commit 81bdbbf

Please sign in to comment.