Skip to content

Commit 17a61c2

Browse files
authored
update to make useable again (#1)
1 parent 64882c5 commit 17a61c2

15 files changed

+584
-42
lines changed

.github/workflows/build_tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Build Tests
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- dev
9+
workflow_dispatch:
10+
11+
jobs:
12+
py_build_tests:
13+
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
14+
with:
15+
test_manifest: true
16+
manifest_ignored: "test/**,scripts/**,CHANGELOG.md,translations/**"
17+
pip_audit:
18+
strategy:
19+
max-parallel: 2
20+
matrix:
21+
python-version: [ "3.10" ]
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Setup Python
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install skill
30+
run: |
31+
pip install .
32+
- uses: pypa/gh-action-pip-audit@v1.0.8
33+
with:
34+
# Ignore setuptools vulnerability we can't do much about
35+
# Ignore numpy vulnerability affecting latest version for Py3.7
36+
ignore-vulns: |
37+
GHSA-r9hx-vwmv-q579
38+
GHSA-fpfv-jqm9-f5jm
39+
PYSEC-2022-43012
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# auto add labels to PRs
2+
on:
3+
pull_request_target:
4+
types: [ opened, edited ]
5+
name: conventional-release-labels
6+
jobs:
7+
label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: bcoe/conventional-release-labels@v1
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run License Tests
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- dev
9+
workflow_dispatch:
10+
11+
jobs:
12+
license_tests:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: "3.10"
20+
- name: Install Build Tools
21+
run: |
22+
python -m pip install build wheel
23+
- name: Install System Dependencies
24+
run: |
25+
sudo apt-get update
26+
sudo apt install python3-dev swig libssl-dev
27+
- name: Install core repo
28+
run: |
29+
pip install .
30+
- name: Get explicit and transitive dependencies
31+
run: |
32+
pip freeze > requirements.txt
33+
- name: Check python
34+
id: license_check_report
35+
uses: pilosus/action-pip-license-checker@v0.5.0
36+
with:
37+
requirements: 'requirements.txt'
38+
fail: 'Copyleft,Other,Error'
39+
fails-only: true
40+
exclude: '^(tqdm|ovos-skill-mark1-ctrl).*'
41+
exclude-license: '^(Mozilla).*$'
42+
- name: Print report
43+
if: ${{ always() }}
44+
run: echo "${{ steps.license_check_report.outputs.report }}"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Stable Release
2+
on:
3+
push:
4+
branches: [master]
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish_stable:
9+
uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master
10+
secrets: inherit
11+
with:
12+
branch: 'master'
13+
version_file: 'version.py'
14+
setup_py: 'setup.py'
15+
publish_release: true
16+
17+
publish_pypi:
18+
needs: publish_stable
19+
if: success() # Ensure this job only runs if the previous job succeeds
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
ref: dev
25+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
26+
- name: Setup Python
27+
uses: actions/setup-python@v1
28+
with:
29+
python-version: "3.10"
30+
- name: Install Build Tools
31+
run: |
32+
python -m pip install build wheel
33+
- name: version
34+
run: echo "::set-output name=version::$(python setup.py --version)"
35+
id: version
36+
- name: Build Distribution Packages
37+
run: |
38+
python setup.py sdist bdist_wheel
39+
- name: Publish to Test PyPI
40+
uses: pypa/gh-action-pypi-publish@master
41+
with:
42+
password: ${{secrets.PYPI_TOKEN}}
43+
44+
45+
sync_dev:
46+
needs: publish_stable
47+
if: success() # Ensure this job only runs if the previous job succeeds
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
with:
52+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
53+
ref: master
54+
- name: Push master -> dev
55+
uses: ad-m/github-push-action@master
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
branch: dev
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Release Alpha and Propose Stable
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches: [dev]
7+
8+
jobs:
9+
publish_alpha:
10+
if: github.event.pull_request.merged == true
11+
uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master
12+
secrets: inherit
13+
with:
14+
branch: 'dev'
15+
version_file: 'version.py'
16+
setup_py: 'setup.py'
17+
update_changelog: true
18+
publish_prerelease: true
19+
changelog_max_issues: 100
20+
21+
notify:
22+
if: github.event.pull_request.merged == true
23+
needs: publish_alpha
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Send message to Matrix bots channel
28+
id: matrix-chat-message
29+
uses: fadenb/matrix-chat-message@v0.0.6
30+
with:
31+
homeserver: 'matrix.org'
32+
token: ${{ secrets.MATRIX_TOKEN }}
33+
channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org'
34+
message: |
35+
new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }}
36+
37+
publish_pypi:
38+
needs: publish_alpha
39+
if: success() # Ensure this job only runs if the previous job succeeds
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
with:
44+
ref: dev
45+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
46+
- name: Setup Python
47+
uses: actions/setup-python@v1
48+
with:
49+
python-version: "3.10"
50+
- name: Install Build Tools
51+
run: |
52+
python -m pip install build wheel
53+
- name: version
54+
run: echo "::set-output name=version::$(python setup.py --version)"
55+
id: version
56+
- name: Build Distribution Packages
57+
run: |
58+
python setup.py sdist bdist_wheel
59+
- name: Publish to Test PyPI
60+
uses: pypa/gh-action-pypi-publish@master
61+
with:
62+
password: ${{secrets.PYPI_TOKEN}}
63+
64+
65+
propose_release:
66+
needs: publish_alpha
67+
if: success() # Ensure this job only runs if the previous job succeeds
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout dev branch
71+
uses: actions/checkout@v3
72+
with:
73+
ref: dev
74+
75+
- name: Setup Python
76+
uses: actions/setup-python@v2
77+
with:
78+
python-version: '3.10'
79+
80+
- name: Get version from setup.py
81+
id: get_version
82+
run: |
83+
VERSION=$(python setup.py --version)
84+
echo "VERSION=$VERSION" >> $GITHUB_ENV
85+
86+
- name: Create and push new branch
87+
run: |
88+
git checkout -b release-${{ env.VERSION }}
89+
git push origin release-${{ env.VERSION }}
90+
91+
- name: Open Pull Request from dev to master
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
run: |
95+
# Variables
96+
BRANCH_NAME="release-${{ env.VERSION }}"
97+
BASE_BRANCH="master"
98+
HEAD_BRANCH="release-${{ env.VERSION }}"
99+
PR_TITLE="Release ${{ env.VERSION }}"
100+
PR_BODY="Human review requested!"
101+
102+
# Create a PR using GitHub API
103+
curl -X POST \
104+
-H "Accept: application/vnd.github+json" \
105+
-H "Authorization: token $GITHUB_TOKEN" \
106+
-d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \
107+
https://api.github.com/repos/${{ github.repository }}/pulls
108+

.github/workflows/sync_tx.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Run script on merge to dev by gitlocalize-app
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- dev
8+
9+
jobs:
10+
run-script:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out repository
14+
uses: actions/checkout@v2
15+
with:
16+
ref: dev
17+
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
18+
- name: Setup Python
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: 3.9
22+
23+
- name: Run script if manual dispatch
24+
if: github.event_name == 'workflow_dispatch'
25+
run: |
26+
python scripts/sync_translations.py
27+
28+
- name: Run script if merged by gitlocalize-app[bot]
29+
if: github.event_name == 'push' && github.event.head_commit.author.username == 'gitlocalize-app[bot]'
30+
run: |
31+
python scripts/sync_translations.py
32+
33+
- name: Commit to dev
34+
uses: stefanzweifel/git-auto-commit-action@v4
35+
with:
36+
commit_message: Update translations
37+
branch: dev

.github/workflows/unit_tests.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Run UnitTests
2+
on:
3+
pull_request:
4+
branches:
5+
- dev
6+
paths-ignore:
7+
- 'version.py'
8+
- 'requirements.txt'
9+
- 'examples/**'
10+
- '.github/**'
11+
- '.gitignore'
12+
- 'LICENSE'
13+
- 'CHANGELOG.md'
14+
- 'MANIFEST.in'
15+
- 'readme.md'
16+
- 'scripts/**'
17+
push:
18+
branches:
19+
- master
20+
paths-ignore:
21+
- 'version.py'
22+
- 'requirements.txt'
23+
- 'examples/**'
24+
- '.github/**'
25+
- '.gitignore'
26+
- 'LICENSE'
27+
- 'CHANGELOG.md'
28+
- 'MANIFEST.in'
29+
- 'readme.md'
30+
- 'scripts/**'
31+
workflow_dispatch:
32+
33+
jobs:
34+
unit_tests:
35+
strategy:
36+
max-parallel: 2
37+
matrix:
38+
python-version: [ 3.9, "3.10" ]
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Set up python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
- name: Install System Dependencies
47+
run: |
48+
sudo apt-get update
49+
sudo apt install python3-dev
50+
python -m pip install build wheel
51+
- name: Install core repo
52+
run: |
53+
pip install .
54+
- name: Install test dependencies
55+
run: |
56+
pip install pytest pytest-timeout pytest-cov
57+
- name: Install System Dependencies
58+
run: |
59+
sudo apt-get update
60+
sudo apt install libfann-dev
61+
- name: Install ovos dependencies
62+
run: |
63+
pip install ovos-plugin-manager ovos-core[skills_lgpl]>=0.0.5a28
64+
- name: Run unittests
65+
run: |
66+
pytest --cov=ovos-skill-template-repo --cov-report xml test/unittests
67+
# NOTE: additional pytest invocations should also add the --cov-append flag
68+
# or they will overwrite previous invocations' coverage reports
69+
# (for an example, see OVOS Skill Manager's workflow)
70+
- name: Upload coverage
71+
env:
72+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
73+
uses: codecov/codecov-action@v2

0 commit comments

Comments
 (0)