test #2266
Workflow file for this run
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
name: ci | |
on: [push, pull_request] | |
jobs: | |
list-packages: # List everything in packages.txt | |
runs-on: ubuntu-20.04 | |
outputs: | |
packages: ${{ steps.set-packages.outputs.packages }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-packages | |
run: echo packages=$(jq -R -s -c 'split("\n")[:-1]' < ./packages.txt) >> $GITHUB_OUTPUT | |
list-build-packages: # List only actual Revolve2 packages from packages.txt | |
runs-on: ubuntu-20.04 | |
outputs: | |
packages: ${{ steps.set-packages.outputs.build-packages }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-packages | |
run: | |
build_packages="$(jq -R -s -c 'split("\n")[:-1] | map(select(. | startswith("examples/") | not)) | map(select(. != "tests"))' < ./packages.txt)" | |
echo build-packages=$build-packages >> $GITHUB_OUTPUT | |
# dev_install: | |
# runs-on: ubuntu-20.04 | |
# strategy: | |
# matrix: | |
# python-version: ["3.10", "3.11"] | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v3 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: install_revolve2 | |
# run: ./dev_install.sh | |
# student_install: | |
# runs-on: ubuntu-20.04 | |
# strategy: | |
# matrix: | |
# python-version: ["3.10", "3.11"] | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v3 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: install_revolve2 | |
# run: ./student_install.sh | |
# check_format: | |
# runs-on: ubuntu-20.04 | |
# strategy: | |
# matrix: | |
# python-version: ["3.10", "3.11"] | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v3 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: install_tools | |
# run: pip install -r ./codetools/requirements.txt | |
# - name: black | |
# run: ./codetools/black/check.sh | |
# - name: isort | |
# run: ./codetools/isort/check.sh | |
# - name: pydocstyle | |
# run: ./codetools/pydocstyle/check.sh | |
# - name: darglint | |
# run: ./codetools/darglint/check.sh | |
# - name: pyflakes | |
# run: ./codetools/pyflakes/check.sh | |
# - name: sort-all | |
# run: | | |
# ./codetools/sort_all/fix.sh | |
# [[ -z $(git status -s) ]] | |
# git checkout -- . | |
# mypy: | |
# needs: list-packages | |
# strategy: | |
# matrix: | |
# python-version: ["3.10", "3.11"] | |
# package: ${{ fromJson(needs.list-packages.outputs.packages) }} | |
# runs-on: ubuntu-20.04 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v3 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: install_tools | |
# run: pip install -r ./codetools/mypy/requirements.txt | |
# - name: Install example requirements | |
# run: | |
# ./dev_install.sh | |
# pip install -r ./${{ matrix.package }}/requirements.txt | |
# if: startsWith(matrix.package, 'examples/') | |
# - name: Install tests requirements | |
# run: | |
# ./dev_install.sh | |
# pip install -r ./tests/requirements.txt | |
# if: "matrix.package == 'tests'" | |
# - name: Install package | |
# run: pip install ./$(echo "${{ matrix.package }}[dev]" | sed 's#/revolve2##') | |
# if: "(!startsWith(matrix.package, 'examples/') && matrix.package != 'tests')" | |
# - name: run_mypy | |
# run: ./codetools/mypy/check.sh ${{ matrix.package }} | |
# docs: | |
# runs-on: ubuntu-20.04 | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-python@v3 | |
# with: | |
# python-version: 3.11 | |
# - name: install_revolve2 | |
# run: ./dev_install.sh | |
# - name: setup_graphviz | |
# uses: ts-graphviz/setup-graphviz@v1 | |
# - name: sphinx | |
# run: make -C docs html | |
# - name: deploy | |
# if: ${{ github.ref == 'refs/heads/master' }} | |
# uses: JamesIves/[email protected] | |
# with: | |
# branch: gh-pages | |
# folder: docs/build/html | |
# clean-exclude: .nojekyll | |
# unit_tests: | |
# runs-on: ubuntu-20.04 | |
# strategy: | |
# matrix: | |
# python-version: [ "3.10", "3.11" ] | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v2 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: install virtual display | |
# run: | | |
# bash .github/workflows/install_display.sh | |
# echo "DISPLAY=:0" >> $GITHUB_ENV | |
# - name: install_revolve2 | |
# run: ./dev_install.sh | |
# - name: run pytest | |
# run: pytest -v | |
build_wheels: | |
needs: list-build-packages | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] #[windows-2022, macos-12,ubuntu-22.04] | |
package: ${{ fromJson(needs.list-build-packages.outputs.build-packages) }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.16.2 | |
- name: Build wheels | |
run: pip wheel ./$(echo "${{ matrix.package }}" | sed 's#/revolve2##') -w dist/$(echo "${{ matrix.package }}" | sed 's#/revolve2##') | |
# - name: Build wheels | |
# run: python -m cibuildwheel ./$(echo "${{ matrix.package }}" | sed 's#/revolve2##') --output-dir dist | |
# env: | |
# CIBW_BUILD: cp310-* cp311-* | |
# CIBW_ARCHS_WINDOWS: AMD64 | |
# CIBW_ARCHS_MACOS: x86_64 arm64 | |
# CIBW_ARCHS_LINUX: x86_64 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ./dist/*.whl |