forked from pbs/pycaption
-
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.
- Loading branch information
Showing
79 changed files
with
7,290 additions
and
4,635 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 @@ | ||
* @pbs/core-services |
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,34 @@ | ||
name: Release PyCaption on GitHub | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
call-unit-tests-workflow: | ||
name: Run unit tests | ||
uses: pbs/pycaption/.github/workflows/unit_tests.yml@main | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
|
||
create-release: | ||
name: Release PyCaption on GitHub | ||
needs: call-unit-tests-workflow | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Extract release notes for current version | ||
env: | ||
TAG: ${{ github.ref }} | ||
run: | | ||
sudo apt-get install -y --no-install-recommends pandoc | ||
pandoc docs/changelog.rst -f rst -t gfm -o changelog.md | ||
sed -n "/## ${TAG#refs/tags/}/,/## /p" changelog.md | sed -e "/## /d" >> notes.md | ||
- name: Create release on GitHub | ||
run: gh release create ${{ github.ref }} --notes-file notes.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,39 @@ | ||
name: Publish PyCaption to PyPI | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
call-unit-tests-workflow: | ||
name: Run unit tests | ||
uses: pbs/pycaption/.github/workflows/unit_tests.yml@main | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
|
||
build-n-publish: | ||
name: Build and publish PyCaption to PyPI | ||
needs: call-unit-tests-workflow | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
python -m pip install --upgrade twine | ||
- name: Build package | ||
run: python -m build | ||
timeout-minutes: 10 | ||
|
||
- name: Publish package on PyPI | ||
run: python -m twine upload --verbose dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
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,40 @@ | ||
name: Publish PyCaption to Test PyPI | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
call-unit-tests-workflow: | ||
name: Run unit tests | ||
uses: ./.github/workflows/unit_tests.yml | ||
secrets: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | ||
|
||
build-n-publish: | ||
name: Build and publish PyCaption to Test PyPI | ||
needs: call-unit-tests-workflow | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
python -m pip install --upgrade twine | ||
- name: Build package | ||
run: python -m build | ||
timeout-minutes: 10 | ||
|
||
- name: Publish package on Test PyPI | ||
run: python -m twine upload --verbose dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
TWINE_REPOSITORY: "testpypi" |
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,79 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_call: | ||
secrets: | ||
SLACK_BOT_TOKEN: | ||
required: true | ||
SLACK_CHANNEL_ID: | ||
required: true | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["py38", "py39", "py310", "py311", "py312"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run Test | ||
id: tests | ||
run: | | ||
./run_tests.sh test_${{ matrix.python-version }} | ||
continue-on-error: true | ||
|
||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-report-${{ matrix.python-version }} | ||
path: junit.xml | ||
|
||
- name: Archive code coverage results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: code-coverage-report-${{ matrix.python-version }} | ||
path: coverage.xml | ||
|
||
- name: Add context info to env | ||
run: | | ||
sudo apt-get install -y --no-install-recommends libxml-xpath-perl | ||
COVERAGE=`xpath -q -e "floor(/coverage/@line-rate * 100)" coverage.xml` | ||
FAILED_AMOUNT=`xpath -q -e "number(/testsuites/testsuite/@failures)" junit.xml` | ||
SKIPPED_AMOUNT=`xpath -q -e "number(/testsuites/testsuite/@skipped)" junit.xml` | ||
PASSED_AMOUNT=`xpath -q -e "/testsuites/testsuite/@tests - $SKIPPED_AMOUNT - $FAILED_AMOUNT" junit.xml` | ||
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV | ||
echo "FAILED_AMOUNT=$FAILED_AMOUNT" >> $GITHUB_ENV | ||
echo "PASSED_AMOUNT=$PASSED_AMOUNT" >> $GITHUB_ENV | ||
${{ contains(github.ref, 'tags/') }} \ | ||
&& BRANCH='refs/heads/main' \ | ||
|| BRANCH=${{ github.head_ref || github.ref }} | ||
echo "BRANCH=${BRANCH#refs/*/}" >> $GITHUB_ENV | ||
- name: Notify if test FAILED | ||
uses: archive/[email protected] | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-text: ":boom: *${{ env.FAILED_AMOUNT }}* Pycaption test(s) failed for Python *${{ matrix.python-version }}* on the *${{ env.BRANCH }}* branch (triggered by *${{ github.actor }}*)" | ||
if: steps.tests.outcome == 'failure' && !github.event.pull_request.head.repo.fork | ||
|
||
- name: Mark test failure | ||
run: exit 1 | ||
if: steps.tests.outcome == 'failure' | ||
|
||
- name: Slack notify tests PASSED | ||
uses: archive/[email protected] | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }} | ||
slack-channel: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-text: ":rocket: All (*${{ env.PASSED_AMOUNT }}*) Pycaption tests passed for Python *${{ matrix.python-version }}* covering *${{ env.COVERAGE }}%* of code on the *${{ env.BRANCH }}* branch (triggered by *${{ github.actor }}*)" | ||
if: steps.tests.outcome == 'success' && !github.event.pull_request.head.repo.fork |
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,17 @@ | ||
repos: | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: debug-statements | ||
|
||
- repo: git://github.com/PyCQA/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: [ | ||
'--exclude=tests/fixtures*', | ||
'--ignore=W503,C901', | ||
'--max-line-length=80', | ||
] |
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 @@ | ||
version: 2 | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.11" | ||
|
||
# Build from the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Explicitly set the version of Python and its requirements | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.