Skip to content

Commit

Permalink
Merge branch 'github-actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-vv committed Oct 12, 2024
2 parents 1ae80cd + 676bec3 commit 502eff3
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 18 deletions.
92 changes: 75 additions & 17 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build_ubuntu:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -25,7 +25,9 @@ jobs:
- name: Build the wheel
run: python setup.py bdist_wheel
- name: Repair wheel with auditwheel
run: auditwheel repair dist/*.whl --plat manylinux2014_x86_64 -w wheelhouse/
run: |
auditwheel show dist/*.whl
auditwheel repair dist/*.whl --plat manylinux_2_31_x86_64 -w wheelhouse/
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -44,8 +46,7 @@ jobs:
- name: Install dependencies
shell: powershell
run: |
choco install -y vcpkg
vcpkg install gsl
vcpkg install gsl:x64-windows-static
pip install --upgrade pip setuptools wheel
- name: Build the wheel
run: python setup.py bdist_wheel
Expand All @@ -57,45 +58,102 @@ jobs:

test_ubuntu:
needs: build_ubuntu
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gmsh
- name: Checkout code
uses: actions/checkout@v3
- name: Download wheel artifact
uses: actions/download-artifact@v3
with:
name: ubuntu-wheel
path: ./
- name: Install the wheel
run: pip install *.whl
- name: Run unit tests
run: |
pip install traceon-*.whl
pip show traceon
- name: Run tests
run: python -m unittest tests.unit_tests

test_windows:
needs: build_windows
runs-on: windows-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Checkout code
uses: actions/checkout@v3
- name: Download wheel artifact
uses: actions/download-artifact@v3
with:
name: windows-wheel
path: ./
- name: Install the wheel
run: |
pip install (get-item traceon-*.whl)
pip show traceon
- name: Run tests
run: python -m unittest tests.unit_tests

upload_ubuntu:
needs: build_ubuntu
runs-on: ubuntu-20.04
if: github.event_name == 'workflow_dispatch'

steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
shell: powershell
- name: Download wheel artifact
uses: actions/download-artifact@v3
with:
name: ubuntu-wheel
path: ./
- name: Install Twine
run: |
choco install -y vcpkg
vcpkg install gsl
pip install --upgrade pip
pip install twine
- name: Upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: python -m twine upload traceon-*.whl

upload_windows:
needs: build_windows
runs-on: windows-latest
if: github.event_name == 'workflow_dispatch'

steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Download wheel artifact
uses: actions/download-artifact@v3
with:
name: windows-wheel
path: ./
- name: Install the wheel
run: pip install *.whl
- name: Run unit tests
run: python -m unittest tests.unit_tests
- name: Install Twine
run: |
pip install --upgrade pip
pip install twine
- name: Upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: python -m twine upload (get-item traceon-*.whl)




2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup, Extension
import platform

VCPKG_DIR = 'C:\\Users\\leonv\\vcpkg'
VCPKG_DIR = 'C:\\vcpkg'

if platform.system() == 'Linux':
os.environ['CC'] = 'clang' # Clang is known to produce faster binaries.
Expand Down

0 comments on commit 502eff3

Please sign in to comment.