-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
297 additions
and
7 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,15 @@ | ||
--- | ||
# Configuration for CodeCov | ||
# See https://docs.codecov.io/docs/codecov-yaml | ||
|
||
codecov: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
# Colour chart range | ||
# In future, aim to update range to stricter standard | ||
range: "20...80" | ||
|
||
comment: | ||
# Only post a comment if coverage changes | ||
require_changes: true |
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,106 @@ | ||
--- | ||
|
||
on: [push,pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install Poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
pip install poetry-dynamic-versioning | ||
- name: Build | ||
run: | | ||
poetry build | ||
- name: Save build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist-artifact | ||
path: dist/ | ||
|
||
test: | ||
name: Test | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist-artifact | ||
path: dist/ | ||
|
||
- name: Install from build | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest-mock | ||
pip install etpproto --pre --target=dist --find-links=dist/ | ||
- name: Copy tests and example data to dist folder for testing against artifacts | ||
run: | | ||
cp -R tests dist/ | ||
# cp -R example_data dist/ | ||
|
||
- name: Run tests | ||
run: pytest dist/tests | ||
|
||
publish: | ||
name: Publish to PyPI | ||
needs: [build, test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist-artifact | ||
path: dist/ | ||
|
||
- name: Install Poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
pip install poetry-dynamic-versioning | ||
- name: Upload to PyPI TEST | ||
run: | | ||
poetry config repositories.test https://test.pypi.org/legacy/ | ||
poetry config http-basic.test ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} ${{ secrets.POETRY_TEST_PYPI_TOKEN_PASSWORD}} | ||
poetry publish --repository test |
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,111 @@ | ||
--- | ||
|
||
name: Publish release | ||
|
||
on: | ||
push: | ||
tags: | ||
# Run when a tag is pushed with a valid semantic version number | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install Poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
pip install poetry-dynamic-versioning | ||
- name: Build | ||
run: | | ||
poetry build | ||
- name: Save build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist-artifact | ||
path: dist/ | ||
|
||
test: | ||
name: Test | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist-artifact | ||
path: dist/ | ||
|
||
- name: Install from build | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest-mock | ||
pip install etpproto --pre --target=dist --find-links=dist/ | ||
- name: Copy tests and example data to dist folder for testing against artifacts | ||
run: | | ||
cp -R tests dist/ | ||
# cp -R example_data dist/ | ||
|
||
- name: Run tests | ||
run: pytest dist/tests | ||
|
||
publish: | ||
name: Publish to PyPI | ||
needs: [build, test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get build artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist-artifact | ||
path: dist/ | ||
|
||
- name: Install Poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
pip install poetry-dynamic-versioning | ||
- name: Upload to PyPI | ||
run: | | ||
poetry config repositories.test https://test.pypi.org/legacy/ | ||
poetry publish --username ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} --password ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD}} |
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,44 @@ | ||
--- | ||
|
||
name: CodeQL | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
# pull_request: | ||
# The branches below must be a subset of the branches above | ||
# branches: [ master ] | ||
schedule: | ||
# 10:16 on Fridays | ||
- cron: '16 10 * * 5' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
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 |
---|---|---|
|
@@ -26,6 +26,7 @@ docs/html | |
build | ||
dist | ||
*.egg-info | ||
venv/ | ||
|
||
# Dynamically-generated version | ||
resqpy/version.py | ||
|
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