Skip to content

Commit

Permalink
mi pana e pali la o alasa e pona ona, o pana e ona
Browse files Browse the repository at this point in the history
  • Loading branch information
gregdan3 committed Apr 23, 2024
1 parent 83717f0 commit 078934a
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
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
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
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 }}

0 comments on commit 078934a

Please sign in to comment.