diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3c7d675..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,135 +0,0 @@ -version: 2.1 - -jobs: - test-python: - parameters: - version: - type: string - tox_env: - type: string - docker: - - image: circleci/python:<< parameters.version >> - steps: - - checkout - - run: sudo apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key - - run: - command: | - echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list - echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-6.0 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list - echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-7 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list - echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list - - run: sudo apt update - - run: sudo apt install -y libclang1-5.0 libclang1-6.0 libclang1-7 libclang1-8 - - run: sudo pip install tox - - run: TOXENV=$(tox --listenvs | grep "^<< parameters.tox_env >>") tox -p auto - - store_test_results: - path: test-results - - build: - docker: - - image: circleci/python:3.6 - steps: - - checkout - - run: python setup.py sdist bdist_wheel - - store_artifacts: - path: dist/ - - persist_to_workspace: - root: dist/ - paths: - - pycodegen-*.tar.gz - - pycodegen-*.whl - - test-install: - parameters: - version: - type: string - docker: - - image: circleci/python:<< parameters.version >> - steps: - - attach_workspace: - at: /tmp/packages - - run: sudo pip install /tmp/packages/pycodegen-*.whl - - run: sudo pip install "pycodegen[CPP]" - - run: pycodegen -h - - deploy-to-pypi: - docker: - - image: circleci/python:3.6 - steps: - - attach_workspace: - at: /tmp/packages - - restore_cache: - key: v1-pip-cache - - run: sudo pip install twine - - save_cache: - key: v1-pip-cache - paths: - - ~/.cache/pip - - run: - command: | - echo -e "[pypi]" >> ~/.pypirc - echo -e "username = $PYPI_USERNAME" >> ~/.pypirc - echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - - deploy: - command: twine upload /tmp/packages/* - -workflows: - version: 2 - build_and_deploy: - jobs: - - test-python: - name: test-python34 - version: "3.4" - tox_env: "py34" - - test-python: - name: test-python35 - version: "3.5" - tox_env: "py35" - - test-python: - name: test-python36 - version: "3.6" - tox_env: "py36" - - test-python: - name: test-python37 - version: "3.7" - tox_env: "py37" - - - build: - requires: - - test-python34 - - test-python35 - - test-python36 - - test-python37 - - - test-install: - name: test-install-python34 - version: "3.4" - requires: - - build - - test-install: - name: test-install-python35 - version: "3.5" - requires: - - build - - test-install: - name: test-install-python36 - version: "3.6" - requires: - - build - - test-install: - name: test-install-python37 - version: "3.7" - requires: - - build - - - deploy-to-pypi: - requires: - - test-install-python34 - - test-install-python35 - - test-install-python36 - - test-install-python37 - filters: - tags: - only: /v[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ea8ef9d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +on: + push: + branches: [master, gh-workflow] + pull_request: + branches: [master] + +jobs: + test: + strategy: + matrix: + include: + - runs-on: ubuntu-latest + container: ubuntu:24.04 + - runs-on: ubuntu-latest + container: ubuntu:26.04 + - runs-on: ubuntu-latest + container: fedora:40 + - runs-on: ubuntu-latest + container: fedora:41 + - runs-on: macos-latest + runs-on: ${{ matrix.runs-on }} + container: ${{ matrix.container || '' }} + steps: + - uses: actions/checkout@v4 + - name: Install system dependencies + run: ${{ matrix.install_deps }} + - uses: astral-sh/setup-uv@v6 + - run: uv sync --group dev --all-extras + - run: uv run nox + + build: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v6 + - run: uv build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + test-install: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - run: pip install dist/*.whl + - run: pycodegen -h diff --git a/README.rst b/README.rst index 4df3797..53f4469 100644 --- a/README.rst +++ b/README.rst @@ -46,8 +46,8 @@ Example usage pycodegen cpp --dump-json -.. |Build Status| image:: https://img.shields.io/circleci/project/github/blejdfist/pycodegen/master.svg?style=flat - :target: https://circleci.com/gh/blejdfist/pycodegen +.. |Build Status| image:: https://github.com/blejdfist/pycodegen/actions/workflows/ci.yml/badge.svg?branch=master + :target: https://github.com/blejdfist/pycodegen/actions/workflows/ci.yml .. |PyPi Version| image:: https://img.shields.io/pypi/v/pycodegen.svg?style=flat :target: https://pypi.org/project/pycodegen/ diff --git a/noxfile.py b/noxfile.py index ab30e9a..0279105 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,7 +2,7 @@ nox.options.default_venv_backend = "uv" -@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]) +@nox.session(python=["3.10", "3.11", "3.12", "3.13", "3.14"]) def tests(session): session.install(".[cpp]", "pytest") session.run("pytest") diff --git a/pyproject.toml b/pyproject.toml index aeec58a..3e34f0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,6 @@ authors = [{ name = "Jim Ekman", email = "jim@nurd.se" }] keywords = ["code generation", "libclang", "codegenerator"] classifiers = [ "Development Status :: 3 - Alpha", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12",