Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
builderjer committed Feb 13, 2024
1 parent 4b9b28e commit 365890f
Show file tree
Hide file tree
Showing 32 changed files with 883 additions and 2,014 deletions.
57 changes: 7 additions & 50 deletions .github/workflows/auto_translate.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,12 @@
name: Auto translate
on:
workflow_call:
inputs:
branch:
description: 'The branch to checkout and run the action in'
type: string
default: ${{ github.ref }}
action_branch:
description: 'The shared action branch to checkout'
type: string
default: main
python_version:
description: 'The python version to use'
type: string
default: "3.8"
locale_folder:
description: 'The base folder to look for localization files'
type: string
default: locale

workflow_dispatch:

jobs:
autotranslate:
env:
API_KEY: ${{secrets.DL_API_KEY}}
LOCALE_FOLDER: ${{ github.workspace }}/action/package/${{ inputs.locale_folder }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
path: action/package/
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
repository: OpenVoiceOS/.github
ref: ${{ inputs.action_branch }}
path: action/github/
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Install Translate Tools
run: |
python -m pip install -r action/github/requirements/pip_translation.txt
- name: Auto Translate
run: |
python action/github/scripts/translate.py
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: autotranslate
repository: action/package/
uses: openvoiceos/.github/.github/workflows/auto_translate.yml@feat/shared_actions1
with:
branch: dev
action_branch: feat/shared_actions1
python_version: "3.10"
locale_folder: locale
105 changes: 10 additions & 95 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,12 @@
name: License Tests
name: License tests
on:
workflow_call:
inputs:
runner:
description: 'Runner to use'
type: string
default: 'ubuntu-latest'
branch:
description: 'Branch to check out'
type: string
default: ${{ github.ref }}
action_branch:
description: 'The shared action branch to checkout'
type: string
default: main
python_version:
description: 'Python version to use'
type: string
default: '3.8'
system_deps:
description: 'Additional system dependencies (whitespace delimited) to install'
required: false
type: string
pip_packages:
description: 'Additional Python packages (whitespace delimited) to install'
type: string
required: false
install_extras:
description: 'Optional extras to install the python package with'
required: false
type: string
packages-exclude:
description: 'Regex to exclude packages from the license check'
type: string
default: '^(precise-runner|fann2|tqdm|bs4|nvidia|bitstruct).*'
licenses-exclude:
description: 'Regex to exclude licenses from the license check'
type: string
default: '^(Mozilla).*$'
workflow_dispatch:
push:

jobs:
license_tests:
timeout-minutes: 15
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
path: action/package/
- name: Checkout Scripts Repo
uses: actions/checkout@v4
with:
path: action/github/
ref: ${{ inputs.action_branch }}
repository: OpenVoiceOS/.github
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Install Custom System Dependencies
if: ${{ inputs.system_deps != null }}
run: |
sudo apt update
sudo apt install -y ${{ inputs.system_deps }}
- name: upgrade pip
run: |
pip install --upgrade pip
- name: Install Custom Python Requirements
if: ${{ inputs.pip_packages != null }}
run: |
pip install ${{ inputs.pip_packages }}
- name: Install repo
run: |
cd ${{ github.workspace }}/action/package
if [ -z ${{ inputs.install_extras }} ]; then
pip install .
else
pip install .[${{ inputs.install_extras }}]
fi
- name: Get explicit and transitive dependencies
run: |
pip freeze > requirements-all.txt
- name: Check licenses
id: license_check_report
uses: pilosus/action-pip-license-checker@v2
with:
requirements: 'requirements-all.txt'
fail: 'Copyleft,Other,Error'
fails-only: true
pre: true
verbose: 2
exclude: ${{ inputs.packages-exclude }}
exclude-license: ${{ inputs.licenses-exclude }}
- name: Print report
if: ${{ always() }}
run: echo "${{ steps.license_check_report.outputs.report }}"
license:
uses: openvoiceos/.github/.github/workflows/license_tests.yml@feat/shared_actions1
with:
branch: ${{ github.head_ref }}
action_branch: feat/shared_actions1
python_version: 3.10
125 changes: 0 additions & 125 deletions .github/workflows/propose_semver_release.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/propose_semver_release_merged.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/propose_stable_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Propose Stable Build
on:
workflow_dispatch:
inputs:
release_type:
type: choice
options:
- "patch"
- "minor"
- "major"

jobs:
build_and_publish:
uses: openvoiceos/.github/.github/workflows/propose_semver_release.yml@feat/shared_actions1
with:
python_version: "3.10"
version_file: skill_randomness/version.py
release_type: ${{inputs.release_type}} # build, minor, major
Loading

0 comments on commit 365890f

Please sign in to comment.