-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from TheJacksonLaboratory/G3-28-installable-gen…
…eweaver-cli-client-with-api-authentication More improvements for CICD
- Loading branch information
Showing
8 changed files
with
107 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: 'Test Coverage Definition' | ||
on: | ||
workflow_call: | ||
inputs: | ||
python-version: | ||
description: Python version to set up' | ||
default: '3.11' | ||
type: string | ||
runner-os: | ||
description: 'Runner OS' | ||
default: 'ubuntu-latest' | ||
type: string | ||
upload-coverage: | ||
description: 'Upload coverage results' | ||
default: true | ||
type: boolean | ||
required-coverage: | ||
description: 'Required coverage percentage' | ||
default: 100 | ||
type: string | ||
jobs: | ||
run-tests: | ||
runs-on: ${{ inputs.runner-os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
if [[ "$RUNNER_OS" == "macOS" ]]; then | ||
echo "/Users/runner/.local/bin:$PATH" >> $GITHUB_PATH | ||
fi | ||
- name: Configure Poetry | ||
run: poetry config virtualenvs.create false | ||
- name: Install dependencies with Poetry | ||
run: poetry install | ||
- name: Test with pytest | ||
run: | | ||
poetry run pytest tests \ | ||
--tb=no \ | ||
--cov=geneweaver.client \ | ||
--cov-report=term \ | ||
--cov-report=html \ | ||
--cov-fail-under=${{ inputs.required-coverage }} > coverage_report.txt | ||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-report | ||
path: coverage_report.txt | ||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-report-html | ||
path: htmlcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: 'Lint Code' | ||
name: 'Lint Code Definition' | ||
on: | ||
workflow_call: | ||
inputs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 9 additions & 16 deletions
25
.github/workflows/run-tests.yml → .github/workflows/coverage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Style | ||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
push: | ||
branches: | ||
- 'main' | ||
jobs: | ||
format-lint: | ||
uses: ./.github/workflows/_format-lint-action.yml | ||
with: | ||
python-version: '3.9' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
push: | ||
branches: | ||
- 'main' | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ['3.9', '3.10', '3.11'] | ||
uses: ./.github/workflows/_run-tests-action.yml | ||
with: | ||
runner-os: ${{ matrix.os }} | ||
python-version: ${{ matrix.python-version }} | ||
required-coverage: ${{ vars.REQUIRED_COVERAGE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "geneweaver-client" | ||
version = "0.3.1a4" | ||
version = "0.3.1a5" | ||
description = "A Python Client for the Geneweaver API" | ||
authors = ["Jax Computational Sciences <[email protected]>"] | ||
readme = "README.md" | ||
|