From c72dffd177ccd2923de705eff8da07588dc1704e Mon Sep 17 00:00:00 2001 From: Laurence Jackson Date: Wed, 22 Dec 2021 17:13:59 +0000 Subject: [PATCH 1/3] run cli tests as job in dev and production workflows --- .github/workflows/cli-test.yml | 44 ------------------------- .github/workflows/tests_development.yml | 32 +++++++++++++++++- .github/workflows/tests_release.yml | 30 +++++++++++++++++ 3 files changed, 61 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/cli-test.yml diff --git a/.github/workflows/cli-test.yml b/.github/workflows/cli-test.yml deleted file mode 100644 index 3b241d8c..00000000 --- a/.github/workflows/cli-test.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow will install Python dependencies, and run the hazen through the CLI to check functionality -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - - -name: CLI test - -on: - pull_request: - push: - branches: - - 'main' - - 'release/*' - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ '3.9', '3.10' ] - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest pytest-cov - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Install hazen - run: | - python setup.py install - - - name: test snr - if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested - run: | - set -Eeuxo pipefail - hazen snr tests/data/snr/Siemens --report diff --git a/.github/workflows/tests_development.yml b/.github/workflows/tests_development.yml index d0675678..c49841ec 100644 --- a/.github/workflows/tests_development.yml +++ b/.github/workflows/tests_development.yml @@ -87,4 +87,34 @@ jobs: label: Test coverage message: ${{ steps.coverageComment.outputs.coverage }} color: ${{ steps.coverageComment.outputs.color }} - namedLogo: python \ No newline at end of file + namedLogo: python + + test_cli: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + python-version: [ '3.9', '3.10' ] + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Install hazen + run: | + python setup.py install + + - name: test snr + if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested + run: | + hazen snr tests/data/snr/Siemens --report \ No newline at end of file diff --git a/.github/workflows/tests_release.yml b/.github/workflows/tests_release.yml index 8d89c31d..64766114 100644 --- a/.github/workflows/tests_release.yml +++ b/.github/workflows/tests_release.yml @@ -55,3 +55,33 @@ jobs: run: | set -Eeuxo pipefail pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=hazenlib tests/ | tee pytest-coverage.txt ; echo $? + + test_cli: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + python-version: [ '3.9', '3.10' ] + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Install hazen + run: | + python setup.py install + + - name: test snr + if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested + run: | + hazen snr tests/data/snr/Siemens --report \ No newline at end of file From 89de962f039bf1907a3aee04380d1ce9df4f1862 Mon Sep 17 00:00:00 2001 From: Laurence Jackson Date: Mon, 10 Jan 2022 16:26:27 +0000 Subject: [PATCH 2/3] tests adding macos-latest to actions --- .github/workflows/tests_development.yml | 4 ++-- .github/workflows/tests_release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_development.yml b/.github/workflows/tests_development.yml index c49841ec..a316e538 100644 --- a/.github/workflows/tests_development.yml +++ b/.github/workflows/tests_development.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-latest, macos-latest ] python-version: [ '3.9', '3.10' ] defaults: run: @@ -94,7 +94,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-latest, macos-latest ] python-version: [ '3.9', '3.10' ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/tests_release.yml b/.github/workflows/tests_release.yml index 64766114..ea3686b1 100644 --- a/.github/workflows/tests_release.yml +++ b/.github/workflows/tests_release.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-latest, macos-latest ] python-version: [ '3.9', '3.10' ] # Service containers to run with `container-job` services: @@ -61,7 +61,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-latest, macos-latest ] python-version: [ '3.9', '3.10' ] steps: - uses: actions/checkout@v2 From 310e1d3723ad1f39a803cb60f3b51d80f4c6bd5a Mon Sep 17 00:00:00 2001 From: Laurence Jackson Date: Mon, 10 Jan 2022 16:35:12 +0000 Subject: [PATCH 3/3] removes macos-latest from actions --- .github/workflows/tests_development.yml | 4 ++-- .github/workflows/tests_release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests_development.yml b/.github/workflows/tests_development.yml index a316e538..c49841ec 100644 --- a/.github/workflows/tests_development.yml +++ b/.github/workflows/tests_development.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ ubuntu-latest ] python-version: [ '3.9', '3.10' ] defaults: run: @@ -94,7 +94,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ ubuntu-latest ] python-version: [ '3.9', '3.10' ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/tests_release.yml b/.github/workflows/tests_release.yml index ea3686b1..64766114 100644 --- a/.github/workflows/tests_release.yml +++ b/.github/workflows/tests_release.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ ubuntu-latest ] python-version: [ '3.9', '3.10' ] # Service containers to run with `container-job` services: @@ -61,7 +61,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ ubuntu-latest ] python-version: [ '3.9', '3.10' ] steps: - uses: actions/checkout@v2