From e41ba805dc2eee0ece5880143a398be76f2e8e39 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Mon, 17 Jan 2022 00:55:46 -0500 Subject: [PATCH] Switch to common workflow --- .github/workflows/dist.yml | 77 +++++--------------------------------- tests/requirements.txt | 1 + tests/run_tests.py | 13 +++++++ tests/run_tests.sh | 17 --------- 4 files changed, 24 insertions(+), 84 deletions(-) create mode 100644 tests/requirements.txt create mode 100755 tests/run_tests.py delete mode 100755 tests/run_tests.sh diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index b734c84e..caddfe0f 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -10,70 +10,13 @@ on: - '*' jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: psf/black@stable - - # - # Test wheels - # - - # test: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [windows-latest, macos-latest, ubuntu-18.04] - # python_version: [3.6, 3.7, 3.8, 3.9] - # architecture: [x86, x64] - # exclude: - # - os: macos-latest - # architecture: x86 - # - os: ubuntu-18.04 - # architecture: x86 - - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: ${{ matrix.python_version }} - # architecture: ${{ matrix.architecture }} - - # - uses: robotpy/build-actions/build-wheel@v2021 - # # - uses: robotpy/build-actions/test-native-wheel@v2021 - - # - uses: robotpy/build-actions/validate-sphinx@v2021 - # if: ${{ matrix.python_version == '3.7' && matrix.os == 'ubuntu-18.04' }} - - - publish-pypi: - runs-on: ubuntu-latest - needs: [check] - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - run: pip install wheel - - - name: Build packages - run: python setup.py sdist bdist_wheel - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} - - ping: - runs-on: ubuntu-latest - needs: [publish-pypi] - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - - steps: - - uses: robotpy/build-actions/ping-meta@v2021 - with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} \ No newline at end of file + ci: + uses: robotpy/build-actions/.github/workflows/package-pure.yml@v2022 + with: + enable_sphinx_check: false + secrets: + SSH_USER: ${{ secrets.SSH_USER }} + SSH_KEY: ${{ secrets.SSH_KEY }} + SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }} + META_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} + PYPI_API_TOKEN: ${{ secrets.PYPI_PASSWORD }} diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 00000000..55b033e9 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1 @@ +pytest \ No newline at end of file diff --git a/tests/run_tests.py b/tests/run_tests.py new file mode 100755 index 00000000..3a9db6e0 --- /dev/null +++ b/tests/run_tests.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 + +import os +from os.path import abspath, dirname +import sys +import subprocess + +if __name__ == "__main__": + + root = abspath(dirname(__file__)) + os.chdir(root) + + subprocess.check_call([sys.executable, "-m", "pytest", "-vv"]) diff --git a/tests/run_tests.sh b/tests/run_tests.sh deleted file mode 100755 index 5e6f3ab5..00000000 --- a/tests/run_tests.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -e - -cd $(dirname $0) - -export PYTHONPATH="../lib" - -if [ "$RUNCOVERAGE" == "1" ]; then - python3 -m coverage run --source pyfrc -m pytest "$@" - python3 -m coverage report -m -else - python3 -m pytest "$@" -fi - -# Run tests on examples repository -if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then - curl https://raw.githubusercontent.com/robotpy/examples/master/_remote_tests.sh | bash -s all -fi