diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index bd50f7f0..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,104 +0,0 @@ -# If branch from same repo is on a PR, don't build both :) -skip_branch_with_pr: true -image: Visual Studio 2017 -clone_folder: C:\projects\exhale - -# See: https://packaging.python.org/guides/supporting-windows-using-appveyor/ -environment: - matrix: - - PYTHON: "C:\\Python27" - TEST_NAME: "win32_py27" - SPHINX_VERSION: "1.8.5" - BREATHE_VERSION: "4.12.0" - - PYTHON: "C:\\Python27-x64" - TEST_NAME: "win64_py27" - SPHINX_VERSION: "1.8.5" - BREATHE_VERSION: "4.12.0" - # Use latest sphinx / breathe (see also: tox.ini) - - PYTHON: "C:\\Python36-x64" - TEST_NAME: "win64_py36" - - PYTHON: "C:\\Python36-x64" - TEST_NAME: "win64_cxx" - -install: - - ps: | - # Make it so codecov etc can be found - $env:Path += ";" + $env:PYTHON + "\\Scripts" - - # install python tests dependencies: doxygen, pip, tox, codecov - if ($env:TEST_NAME -Match "py") { - $pip_exec = $env:PYTHON + "\\python.exe" - $pip_args = "-m", "pip", "install", "--no-warn-script-location", "-U", "pip", "tox", "codecov" - & $pip_exec $pip_args - - # Fetch the pre-compiled binary release for doxygen directly. - mkdir doxygen - cd doxygen - $doxy_src = "https://sourceforge.net/projects/doxygen/files/rel-1.8.15/doxygen-1.8.15.windows.x64.bin.zip" - $doxy_dst = "c:\projects\exhale\doxygen\doxygen-1.8.15.windows.x64.bin.zip" - # Needs -UserAgent "NativeHost" to follow sourceforge redirects - Invoke-WebRequest -Uri $doxy_src -OutFile $doxy_dst -UserAgent "NativeHost" - # Extracts `doxygen.exe`, `doxyindexer.exe`, `doxysearch.cgi.exe`, and - # `libclang.dll` to same directory aka c:\projects\exhale\doxygen\doxygen.exe - # is what we want to use. - 7z x doxygen-1.8.15.windows.x64.bin.zip - $env:Path += ";c:\projects\exhale\doxygen" - } - # install cxx tests dependencies: pip, codecov, opencppcoverage - else { - $pip_exec = $env:PYTHON + "\\python.exe" - $pip_args = "-m", "pip", "install", "--no-warn-script-location", "-U", "pip", "codecov" - & $pip_exec $pip_args - - choco install --no-progress opencppcoverage - $env:Path += ";" + "C:\Program Files\OpenCppCoverage" - } - -build: off - -test_script: - - ps: | - if ($env:TEST_NAME -Match "py") { - # Prints setuptools version - easy_install --version - - # Print doxygen version - Write-Host "Doxygen version:" - doxygen --version - - # Installs dependencies and runs the tests. - $tox_exec = $env:PYTHON + "\\Scripts\\tox" - $tox_args = "-e", "py", "--", "--cov-report", "xml:coverage.xml", "--cov" - & $tox_exec $tox_args - } - else { - cd testing\projects - mkdir build - cd build - cmake -G "Visual Studio 15 2017" .. - cmake --build . - cmake --build . --target coverage-xml - } - -# Why use Invoke-Expression like this? Because I keep getting -# -# codecov : The filename, directory name, or volume label syntax is incorrect. -# -# Which reports the build as failed, but Invoke-Expression always succeeds xD -after_test: - - ps: | - if ($env:TEST_NAME -Match "cxx") { - # Gerrymander generated coverage report to include paths from the repository - # root (rather than let AppVeyor build folder paths leak in). - # Take note of two things: (1) no C:\\ at beginning, and (2) clone_folder above - (Get-Content .\coverage.xml) -replace '(.*)filename=\"projects\\exhale\\(.*)\"(.*)', '$1 filename="$2"$3' | Set-Content .\coverage.xml - Copy-Item .\coverage.xml -Destination C:\projects\exhale - cd C:\projects\exhale - - $codecov_cmd = '& codecov -X gcov -f .\coverage.xml --name ' + $env:TEST_NAME - Invoke-Expression $codecov_cmd - } - else { - $codecov_cmd = '& codecov -X gcov -f c:\projects\exhale\coverage.xml --name ' + $env:TEST_NAME - Invoke-Expression $codecov_cmd - } diff --git a/.github/workflows/test_extras.yaml b/.github/workflows/test_extras.yaml new file mode 100644 index 00000000..c8c317d6 --- /dev/null +++ b/.github/workflows/test_extras.yaml @@ -0,0 +1,71 @@ +name: Test Extras +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build_docs: + name: Docs + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + - name: Use Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install Tools + run: | + pip install -U tox + sudo apt-get install -y graphviz + - name: Install Tools + run: pip install -U tox + - name: Test Docs + run: | + tox -e docs + + build_linkcheck: + name: Linkcheck + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + - name: Use Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install Tools + run: | + pip install -U tox + sudo apt-get install -y graphviz + - name: Test Linkcheck + run: | + tox -e linkcheck + + build_flake8: + name: Flake8 + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + - name: Use Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install Tools + run: | + pip install -U tox + sudo apt-get install -y graphviz + - name: Test Flake8 + run: | + tox -e flake8 diff --git a/.github/workflows/test_python.yaml b/.github/workflows/test_python.yaml new file mode 100644 index 00000000..dd387327 --- /dev/null +++ b/.github/workflows/test_python.yaml @@ -0,0 +1,141 @@ +name: Test Python +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + ########################################################################## + - name: Install Doxygen (macOS) + if: contains(matrix.os, 'macos') + run: | + brew tap-new $USER/local-doxygen + brew extract --version=1.8.20 doxygen $USER/local-doxygen + HOMEBREW_NO_AUTO_UPDATE=1 brew install -v doxygen@1.8.20 + - name: Install Doxygen (Ubuntu) + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get install -y doxygen + - name: Install Doxygen (Windows) + if: contains(matrix.os, 'windows') + run: | + choco install doxygen.install --version 1.8.20 + echo "C:\Program Files\doxygen\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + ########################################################################## + - name: Doxygen Version Dump + run: doxygen --version + ########################################################################## + - name: Use Python 2.7 + uses: actions/setup-python@v2 + with: + python-version: 2.7 + - name: Install Python Tools + run: pip install -U tox codecov coverage + - name: Test Python 2.7 + env: + SPHINX_VERSION: '==1.8.5' + BREATHE_VERSION: '==4.12.0' + run: tox -e py -- --cov-report xml:coverage.xml --cov + - name: Upload Code Coverage for Python 2.7 + run: | + codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py2.7" + - name: Cleanup Python 2.7 + run: | + mv .gitignore nolongerignored + git clean -n + git clean -f + git reset --hard + ########################################################################## + - name: Use Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install Python Tools + run: pip install -U tox codecov coverage + - name: Test Python 3.6 + env: + SPHINX_VERSION: '==1.8.5' + BREATHE_VERSION: '==4.12.0' + run: tox -e py -- --cov-report xml:coverage.xml --cov + - name: Upload Code Coverage for Python 3.6 + run: | + codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py3.6" + - name: Cleanup Python 3.6 + run: | + mv .gitignore nolongerignored + git clean -n + git clean -f + git reset --hard + ########################################################################## + - name: Use Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install Python Tools + run: pip install -U tox codecov coverage + - name: Test Python 3.7 + env: + SPHINX_VERSION: '==2.0.0' + BREATHE_VERSION: '==4.14.0' + run: tox -e py -- --cov-report xml:coverage.xml --cov + - name: Upload Code Coverage for Python 3.7 + run: | + codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py3.7" + - name: Cleanup Python 3.7 + run: | + mv .gitignore nolongerignored + git clean -n + git clean -f + git reset --hard + ########################################################################## + - name: Use Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install Python Tools + run: pip install -U tox codecov coverage + - name: Test Python 3.8 + env: + SPHINX_VERSION: '==3.0.0' + run: tox -e py -- --cov-report xml:coverage.xml --cov + - name: Upload Code Coverage for Python 3.8 + run: | + codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py3.8" + - name: Cleanup Python 3.8 + run: | + mv .gitignore nolongerignored + git clean -n + git clean -f + git reset --hard + ########################################################################## + - name: Use Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install Python Tools + run: pip install -U tox codecov coverage + - name: Test Python 3.9 + env: + SPHINX_VERSION: '>=4.0.0' + run: tox -e py -- --cov-report xml:coverage.xml --cov + - name: Upload Code Coverage for Python 3.9 + run: | + codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py3.9" + - name: Cleanup Python 3.9 + run: | + mv .gitignore nolongerignored + git clean -n + git clean -f + git reset --hard diff --git a/.github/workflows/testing_projects.yaml b/.github/workflows/testing_projects.yaml new file mode 100644 index 00000000..d36f445d --- /dev/null +++ b/.github/workflows/testing_projects.yaml @@ -0,0 +1,113 @@ +name: Testing Projects +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build_linux: + name: Linux + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - name: Use Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install Build Tools + run: | + pip install -U pip + pip install codecov gcovr + # cpp_long_names test runs code from testing/tests/cpp_long_names.py, + # so we need to install the runtime dependencies of Exhale's Python tests. + pip install -r requirements.txt -r requirements-dev.txt + sudo apt-get install -y \ + cmake \ + gcc \ + g++ \ + gfortran \ + make + + - name: Build Tool Versions + run: | + gcc --version + g++ --version + gfortran --version + cmake --version + + - name: Build and Upload Coverage + run: | + cd testing/projects + mkdir build + cd build + cmake .. + make -j + make coverage-xml + codecov -X gcov -f .\coverage.xml --name linux_cxx + + build_windows: + name: Windows + runs-on: windows-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + + - name: Use Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install Build Tools + run: | + pip install -U pip + pip install codecov gcovr + # cpp_long_names test runs code from testing/tests/cpp_long_names.py, + # so we need to install the runtime dependencies of Exhale's Python tests. + pip install -r requirements.txt -r requirements-dev.txt + + choco install opencppcoverage + echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Setup Windows Dev Env + uses: ilammy/msvc-dev-cmd@v1.9.0 + with: + arch: x64 + + - name: Install Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build Tool Versions + run: | + cl + ninja --version + cmake --version + + - name: Build and Upload Coverage + run: | + cd testing\projects + mkdir build + cd build + cmake .. -G Ninja + ninja + ninja coverage-xml + + # Gerrymander generated coverage report to include paths from the + # repository root (rather than let GitHub Actions build folder paths + # leak in -- D:\a\exhale\exhale). + (Get-Content .\coverage.xml) -replace '(.*)filename=\"a\\exhale\\exhale\\(.*)\"(.*)', '$1 filename="$2"$3' | Set-Content .\coverage.xml + Copy-Item .\coverage.xml -Destination D:\a\exhale\exhale + cd D:\a\exhale\exhale + type coverage.xml + + $codecov_cmd = '& codecov -X gcov -f .\coverage.xml --name windows_cxx' + Invoke-Expression $codecov_cmd diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 80ca5eec..00000000 --- a/.travis.yml +++ /dev/null @@ -1,164 +0,0 @@ -sudo: false - -branches: - # Other branches receive a Pull Request build. - only: - - master - -# Sphinx version testing done only on Linux (fastest boot / install times). -# Each test must specify `python: X.Y` and `env: PY=X.Y SPHINX_VERSION=X.Y.Z`. -# The `tox.ini` file checks the environment variable `SPHINX_VERSION` as an override -# available to test against a specific version of Sphinx rather than the latest version. -# The PY environment variable is just to make the Travis CI user interface a little more -# straightforward which test is which. See examples below under matrix:include:. -linux_specifications: &linux_specs - os: linux - language: python - addons: - apt: - packages: - # The dependencies for compiling doxygen from source. - - flex - - bison - install: - # NOTE: doxygen doesn't seem to work with latest cmake // ninja :/ - - pip install cmake - - mkdir doxygen && cd doxygen - - curl -LO https://github.com/doxygen/doxygen/archive/Release_1_8_15.tar.gz - - tar -xf Release_1_8_15.tar.gz - - cd doxygen-Release_1_8_15 - - mkdir build && cd build - - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../.. - - make -j - - make install - - cd $(git rev-parse --show-toplevel) - - export PATH="$PWD/doxygen/bin:$PATH" - - pip install -U pip setuptools tox codecov - script: - - doxygen --version - - tox -e py -- --cov-report xml:coverage.xml --cov - after_success: - - codecov -X gcov -f coverage.xml --name "$(echo "linux-py@$PY-sphinx@$SPHINX_VERSION")" - -matrix: - allow_failures: - - env: ALLOW_ME_TO=FAIL - include: - #################################################################################### - # Linux :: Python :: 2.7 # - #################################################################################### - - <<: *linux_specs - python: "2.7" - env: PY=2.7 SPHINX_VERSION=1.8.5 BREATHE_VERSION=4.12.0 - #################################################################################### - # Linux :: Python :: 3.6 # - #################################################################################### - - <<: *linux_specs - python: "3.6" - env: PY=3.6 SPHINX_VERSION=1.8.5 BREATHE_VERSION=4.12.0 - # Use latest sphinx / breathe (see also: tox.ini) - - <<: *linux_specs - python: "3.6" - env: PY=3.6 - #################################################################################### - # OSX :: Python :: 2.7 # - #################################################################################### - - os: osx - language: generic - env: PY=2.7 SPHINX_VERSION=1.8.5 BREATHE_VERSION=4.12.0 HOMEBREW_NO_AUTO_UPDATE=1 - before_install: - # Something strange about final step of install gives exit code != 1 but the - # installation appears to work? - - brew install python@2 || true - install: - - brew install doxygen - - /usr/local/bin/pip install -U tox codecov - script: - - doxygen --version - - /usr/local/bin/python2 --version - - /usr/local/bin/python2 -m tox -e py -- --cov-report xml:coverage.xml --cov - after_success: - - codecov -X gcov -f coverage.xml --name osx_py2.7 - #################################################################################### - # OSX :: Python :: 3.6 # - #################################################################################### - - os: osx - language: generic - # Use latest sphinx / breathe (see also: tox.ini) - env: PY=3.6 HOMEBREW_NO_AUTO_UPDATE=1 - before_install: - - brew upgrade python || true - install: - - brew install doxygen - - /usr/local/bin/pip3 install -U tox codecov - script: - - doxygen --version - - /usr/local/bin/python3 --version - - /usr/local/bin/python3 -m tox -e py -- --cov-report xml:coverage.xml --cov - after_success: - - codecov -X gcov -f coverage.xml --name osx_py3.6 - #################################################################################### - # Flake8 # - #################################################################################### - - os: linux - language: python - env: TEST=flake8 - python: "3.6" - install: - - pip install -U tox - script: - - tox -e flake8 - #################################################################################### - # Docs and Linkcheck # - #################################################################################### - - os: linux - addons: - apt: - packages: - - graphviz - language: python - python: "3.6" - env: TEST=docs_linkcheck - install: - - pip install -U tox - script: - - tox -e docs,linkcheck - #################################################################################### - # testing/projects Code Validation # - #################################################################################### - - os: linux - dist: xenial - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-8 - - g++-8 - - gfortran-8 - - python3 - - python3-venv - - cmake - language: cpp # mostly ;) - env: TEST=testing/projects - before_install: - - export CC=gcc-8 - - export CXX=g++-8 - - export FC=gfortran-8 - install: - # I don't want to require sudo because I don't want to wait ;) - - python3 -m venv venv - - source venv/bin/activate - - pip install -U pip codecov gcovr - # cpp_long_names test runs code from testing/tests/cpp_long_names.py, so we need - # to install the runtime dependencies of Exhale's Python tests. - - pip install -r requirements.txt -r requirements-dev.txt - script: - - cd testing/projects - - mkdir build && cd build - - cmake --version - - cmake .. - - make -j - - make coverage-xml - after_success: - - codecov --name linux_cxx diff --git a/README.rst b/README.rst index f646ac07..9c1fca19 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ Exhale ======================================================================================== -|docs| |pypi| |travis| |appveyor| |coverage| |license| +|docs| |pypi| |coverage| |license| .. begin_badges @@ -12,14 +12,6 @@ Exhale :alt: Latest Version :target: https://badge.fury.io/py/exhale -.. |travis| image:: https://travis-ci.com/svenevs/exhale.svg?branch=master - :alt: Travis CI Build Status (Unix, Flake8 and Docs Tests) - :target: https://app.travis-ci.com/github/svenevs/exhale - -.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/g6ja670b5dgkej7u/branch/master - :alt: AppVeyor CI Build Satus (Windows Tests) - :target: https://ci.appveyor.com/project/svenevs/exhale - .. |coverage| image:: https://codecov.io/gh/svenevs/exhale/branch/master/graph/badge.svg :alt: Code Coverage Report :target: https://codecov.io/gh/svenevs/exhale diff --git a/docs/testing.rst b/docs/testing.rst index 456a682e..e7d3c24b 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -1,6 +1,6 @@ Testing Suite ======================================================================================== -|travis| |appveyor| |coverage| +|coverage| .. include:: ../README.rst :start-after: begin_badges diff --git a/docs/testproject.py b/docs/testproject.py index 414c4a88..365ede5d 100644 --- a/docs/testproject.py +++ b/docs/testproject.py @@ -53,6 +53,12 @@ def get_projects_baseurl(): if https_match: user = https_match.groups()[0] + # HTTPS url as done by GitHub Actions. + https_re = r"https://github\.com/(.*)/exhale" # no .git + https_match = re.match(https_re, git_remote_out) + if https_match: + user = https_match.groups()[0] + # SSH url: git@github.com:svenevs/exhale.git ssh_re = r"git@github\.com:(.*)/exhale\.git" ssh_match = re.match(ssh_re, git_remote_out)