-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from MarcCote/add_github_actions
Add GitHub actions
- Loading branch information
Showing
14 changed files
with
229 additions
and
54 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
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
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
This file was deleted.
Oops, something went wrong.
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,170 @@ | ||
name: Build and upload to PyPI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheel for cp${{ matrix.cp }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
# Ensure that a wheel builder finishes even if another fails | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Linux 64 bit manylinux2014 | ||
- os: ubuntu-latest | ||
python: '3.9' | ||
cp: '39' | ||
platform_id: manylinux_x86_64 | ||
manylinux_image: manylinux2014 | ||
- os: ubuntu-latest | ||
python: '3.10' | ||
cp: '310' | ||
platform_id: manylinux_x86_64 | ||
manylinux_image: manylinux2014 | ||
- os: ubuntu-latest | ||
python: '3.11' | ||
cp: '311' | ||
platform_id: manylinux_x86_64 | ||
manylinux_image: manylinux2014 | ||
- os: ubuntu-latest | ||
python: '3.12' | ||
cp: '312' | ||
platform_id: manylinux_x86_64 | ||
manylinux_image: manylinux2014 | ||
|
||
# MacOS x86_64 | ||
- os: macos-13 | ||
python: '3.9' | ||
cp: '39' | ||
platform_id: macosx_x86_64 | ||
- os: macos-13 | ||
python: '3.10' | ||
cp: '310' | ||
platform_id: macosx_x86_64 | ||
- os: macos-13 | ||
python: '3.11' | ||
cp: '311' | ||
platform_id: macosx_x86_64 | ||
- os: macos-13 | ||
python: '3.12' | ||
cp: '312' | ||
platform_id: macosx_x86_64 | ||
|
||
# MacOS arm64 | ||
- os: macos-14 | ||
python: '3.9' | ||
cp: '39' | ||
platform_id: macosx_arm64 | ||
- os: macos-14 | ||
python: '3.10' | ||
cp: '310' | ||
platform_id: macosx_arm64 | ||
- os: macos-14 | ||
python: '3.11' | ||
cp: '311' | ||
platform_id: macosx_arm64 | ||
- os: macos-14 | ||
python: '3.12' | ||
cp: '312' | ||
platform_id: macosx_arm64 | ||
|
||
steps: | ||
- name: Checkout TextWorld | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Wheel | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp${{ matrix.cp }}-${{ matrix.platform_id }} | ||
CIBW_ARCHS: all | ||
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} | ||
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }} | ||
CIBW_BUILD_VERBOSITY: 1 | ||
with: | ||
output-dir: wheelhouse | ||
|
||
- name: Install dependencies (Linux) | ||
run: sudo apt update && sudo apt install -y --no-install-recommends graphviz | ||
if: startsWith(matrix.os, 'ubuntu') | ||
|
||
- name: Install dependencies (MacOS) | ||
run: brew install graphviz | ||
if: startsWith(matrix.os, 'macos') | ||
|
||
- name: Use Python ${{ matrix.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install TextWorld from the wheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install `ls wheelhouse/*.whl`[full] | ||
- name: Run tests | ||
run: | | ||
pytest --durations=10 tests/ textworld/ | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: tw-wheels-cp${{ matrix.cp }}-${{ matrix.platform_id }} | ||
path: wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
# Build the source distribution under Linux | ||
build_sdist: | ||
name: Source distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build --sdist | ||
- name: Store artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tw-sdist | ||
path: dist/*.tar.gz | ||
if-no-files-found: error | ||
|
||
upload_pypi: | ||
name: >- | ||
Publish TextWorld 📦 to PyPI | ||
needs: | ||
- build_wheels | ||
- build_sdist | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/project/textworld/ | ||
permissions: | ||
id-token: write # mandatory for trusted publishing | ||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: tw-* | ||
path: dist | ||
merge-multiple: true | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true |
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,43 @@ | ||
name: "Test from PyPi" | ||
|
||
on: | ||
workflow_dispatch: | ||
# Schedule a workflow to run at 00:00 (UTC) on the first of every month | ||
schedule: | ||
- cron: "0 0 1 * *" | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-13, macos-14] | ||
python: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Python ${{ matrix.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install dependencies (Linux) | ||
run: sudo apt update && sudo apt install -y --no-install-recommends graphviz | ||
if: startsWith(matrix.os, 'ubuntu') | ||
|
||
- name: Install dependencies (MacOS) | ||
run: brew install graphviz | ||
if: startsWith(matrix.os, 'macos') | ||
|
||
- name: Install TextWorld | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-azurepipelines pytest-cov | ||
pip install --pre textworld[full] | ||
- name: Run tests | ||
run: | | ||
pytest --durations=10 --junitxml=junit/test-results.xml --cov=textworld --cov-report=xml --cov-report=html tests/ textworld/ | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
path: junit/test-results.xml |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.6.2rc4' | ||
__version__ = '1.6.2rc5' |