From ac073ac59f9d3358110a6b2f413e22c690080eda Mon Sep 17 00:00:00 2001 From: KareemMarzouk Date: Wed, 20 Sep 2023 12:02:03 +0100 Subject: [PATCH 1/3] test workflow tests on macos --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f438b1..5a7a889 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,8 @@ jobs: test: strategy: matrix: - os: ["ubuntu-latest"] # To include macos-latest +# os: ["ubuntu-latest", "macos-latest"] # TODO: use full matrix on PR to main/python else just ubuntu + os: ["macos-latest"] # TMP Whilst testing python-version: ["3.11"] name: test with python ${{ matrix.python-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} From 1c6f66eb349d1869f534217eff35fa251e59edea Mon Sep 17 00:00:00 2001 From: KareemMarzouk Date: Wed, 20 Sep 2023 12:03:34 +0100 Subject: [PATCH 2/3] update tests to run on osx-actions branch (tmp) --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a7a889..94e2786 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: push: branches: - python-dev + - osx-actions pull_request: branches: - python From 81bdbbf8337f2a0f974f011509a4680911c4a232 Mon Sep 17 00:00:00 2001 From: KareemMarzouk Date: Wed, 20 Sep 2023 12:27:54 +0100 Subject: [PATCH 3/3] update workflow files --- .github/workflows/dev_tests.yml | 62 +++++++++++++++++++ .../workflows/{test.yml => main_tests.yml} | 12 ++-- 2 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/dev_tests.yml rename .github/workflows/{test.yml => main_tests.yml} (87%) mode change 100644 => 100755 diff --git a/.github/workflows/dev_tests.yml b/.github/workflows/dev_tests.yml new file mode 100644 index 0000000..20c96f8 --- /dev/null +++ b/.github/workflows/dev_tests.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/main_tests.yml old mode 100644 new mode 100755 similarity index 87% rename from .github/workflows/test.yml rename to .github/workflows/main_tests.yml index 94e2786..ded6084 --- a/.github/workflows/test.yml +++ b/.github/workflows/main_tests.yml @@ -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: @@ -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 }} @@ -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