-
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.
mi pana e pali la o alasa e pona ona, o pana e ona
- Loading branch information
Showing
2 changed files
with
115 additions
and
0 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,67 @@ | ||
--- | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
- working | ||
- "feature/*" | ||
paths-ignore: | ||
- "docs/**" | ||
- "news/**" | ||
- "*.md" | ||
- Dockerfile | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
- working | ||
- "feature/*" | ||
paths-ignore: | ||
- "docs/**" | ||
- "news/**" | ||
- "*.md" | ||
- Dockerfile | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.event.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Testing: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
arch: [x64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: ${{ matrix.arch }} | ||
allow-prereleases: true | ||
- name: Set Variables | ||
id: set_variables | ||
shell: bash | ||
run: | | ||
echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_OUTPUT | ||
- name: Cache venv | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-${{ hashFiles('pdm.lock') }} | ||
restore-keys: | | ||
venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}- | ||
- name: Install Dev Dependencies | ||
run: | | ||
pdm install --verbose --dev --group :all --without nltk | ||
pdm info | ||
- name: Run Tests | ||
run: pdm run pytest --cov=otokipona --cov-config=pyproject.toml tests |
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,48 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release-pypi: | ||
name: release-pypi | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-pdm@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Check prerelease | ||
id: check_version | ||
run: | | ||
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9.]+$ ]]; then | ||
echo "PRERELEASE=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "PRERELEASE=true" >> $GITHUB_OUTPUT | ||
fi | ||
# NOTE: pdm build does not require dependencies | ||
- name: Build artifacts | ||
run: pdm build | ||
- name: Publish package distributions to PyPI | ||
run: pdm publish --no-build | ||
|
||
- name: Create release | ||
uses: comnoco/[email protected] | ||
# github's actions/create-release is archived | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: v${{ github.ref }} | ||
draft: false | ||
prerelease: ${{ steps.check_version.outputs.PRERELEASE }} |