From a61c85dfcb5776e86751fcf54527b93abf5c5e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Duque=20Mesa?= <675763+sduquemesa@users.noreply.github.com> Date: Wed, 3 Nov 2021 00:25:07 -0500 Subject: [PATCH] add workflow badges to README (#294) * impl [github] - new YAML issue and feature request template * impl [__init__] - about info function implement a new `about()` for TW: `import thewalrus as tw; tw.about()` * fix [github] - issue_template: indentation * fix [github] - issue_template: id without whitespaces * Copyright update thewalrus/__init__.py Co-authored-by: Theodor * Update URL on .github/ISSUE_TEMPLATE/feature_request.yaml Co-authored-by: Theodor * Update URL .github/ISSUE_TEMPLATE/bug_report.yaml Co-authored-by: Theodor * Apply suggestions from code review Co-authored-by: Theodor * edit [__init__] - about: remove personal username * test [__init__] - about * refactor [__init__] - unused imports * fix [__init__] - about: remove cython * impl [github] - format checks * refactor [github] - python tests * impl [github] - cpp tests * impl [github] - build wheels * remove [CI] - appveyor and CircleCI * rename [github] - jobs * fix [actions] - new line at end of file * fix [actions] - new line at end of file * upgrade [actions] - mac osx version * remove [wheels_linux] - build only for x86_64 arch * refactor [wheels] - remove failfast strategy for win and linux * fix [workflows] - remove conditional to upload artifacts only on master brahc * format [thewalrus] - black * rename [wheels] - upload artifacts name as is * revert commit: 37f9997 fix [workflows] - remove conditional to upload artifacts only on master brach * refactor [wheels_macos] - build inly x86_64 * bump [github] - python version from 3.7 to 3.9 * fix [github/tests] - syntax * refactor [tests] - c++ tests - bump pyhon version to 3.9 - use $HOME instead of ~ * fix [tests/c++] - downlaod and extract from stdout * refactor [tests/c++] - use libgtest-dev instead of comiling from source * refactor [workflows] - build wheels using a single actions * rename [workflows/tests] - rename action to match style on badge * fix [README] - update badges - removes appveyor and circleci badges - adds gh actions badges for tests and build actions * fix [workflows/build] - remove duplicated `name` on jobs * rename [actions/jobs] - renaming for consistent formatting * rename [actions/jobs] - renaming for consistent formatting * delete [workflows] - wheels* Co-authored-by: Theodor --- .github/workflows/build.yml | 141 +++++++++++++++++++++++++++++ .github/workflows/format.yml | 2 +- .github/workflows/tests.yml | 6 +- .github/workflows/wheels_linux.yml | 57 ------------ .github/workflows/wheels_macos.yml | 61 ------------- .github/workflows/wheels_win.yml | 51 ----------- README.rst | 12 +-- 7 files changed, 151 insertions(+), 179 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/wheels_linux.yml delete mode 100644 .github/workflows/wheels_macos.yml delete mode 100644 .github/workflows/wheels_win.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..41dbc9e17 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,141 @@ +name: build +on: + push: + branches: + - master + pull_request: + +jobs: + linux-wheels-x86-64: + name: wheels linux + strategy: + matrix: + os: [ubuntu-latest] + arch: [x86_64] + runs-on: ${{ matrix.os }} + + env: + CIBW_BUILD: 'cp37-* cp38-* cp39-*' + # Python build settings + CIBW_BEFORE_BUILD: | + pip install numpy==1.19.5 scipy cython + # Testing of built wheels + CIBW_TEST_REQUIRES: numpy scipy pytest pytest-cov pytest-randomly flaky + CIBW_TEST_COMMAND: python -m pytest --randomly-seed=137 {project}/thewalrus + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_BUILD_VERBOSITY: 1 + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.1 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.9' + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==1.12.0 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_ARCHS_LINUX: ${{matrix.arch}} + + - uses: kittaakos/upload-artifact-as-is@v0 + if: github.ref == 'refs/heads/master' + with: + path: ./wheelhouse/ + + mac-wheels-x86-64: + name: wheels macos + strategy: + fail-fast: false + matrix: + os: [macos-11] + arch: [x86_64] + runs-on: ${{ matrix.os }} + + env: + CIBW_BUILD: 'cp37-* cp38-* cp39-*' + # MacOS specific build settings + CIBW_BEFORE_ALL_MACOS: | + brew install gmp gcc libomp; + # Python build settings + CIBW_BEFORE_BUILD: | + pip install numpy==1.19.5 scipy cython + # Testing of built wheels + CIBW_TEST_REQUIRES: numpy scipy pytest pytest-cov pytest-randomly flaky + CIBW_TEST_COMMAND: | + python -m pytest --randomly-seed=137 {project}/thewalrus + CIBW_BUILD_VERBOSITY: 1 + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.1 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.9' + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==1.12.0 + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_ARCHS_MACOS: ${{matrix.arch}} + + - uses: kittaakos/upload-artifact-as-is@v0 + if: github.ref == 'refs/heads/master' + with: + path: ./wheelhouse/ + + win-wheels: + name: wheels windows + strategy: + matrix: + os: [windows-latest] + runs-on: ${{ matrix.os }} + + env: + CIBW_BUILD: 'cp37-* cp38-* cp39-*' + # Python build settings + CIBW_BEFORE_BUILD: | + pip install numpy==1.19.5 scipy cython + # Testing of built wheels + CIBW_TEST_REQUIRES: | + numpy scipy pytest pytest-cov pytest-randomly flaky + CIBW_TEST_COMMAND: | + python -m pytest --randomly-seed=137 {project}/thewalrus + CIBW_BUILD_VERBOSITY: 1 + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.1 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.9' + + - name: Build wheels + uses: pypa/cibuildwheel@v1.12.0 + + - uses: kittaakos/upload-artifact-as-is@v0 + if: github.ref == 'refs/heads/master' + with: + path: ./wheelhouse/ diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 04d8b49ce..7370b72d6 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,4 +1,4 @@ -name: Formatting check +name: format on: pull_request: push: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bae96c748..d863f051b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Tests +name: tests on: push: branches: @@ -7,7 +7,7 @@ on: jobs: python-tests: - name: Python tests + name: python runs-on: ubuntu-latest steps: @@ -49,7 +49,7 @@ jobs: file: ./coverage.xml cpp-tests: - name: C++ tests + name: c++ runs-on: ubuntu-latest steps: diff --git a/.github/workflows/wheels_linux.yml b/.github/workflows/wheels_linux.yml deleted file mode 100644 index a850d94bf..000000000 --- a/.github/workflows/wheels_linux.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Wheels Linux -on: - push: - branches: - - master - pull_request: - -env: - CIBW_BUILD: 'cp37-* cp38-* cp39-*' - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install numpy==1.19.5 scipy cython - - # Testing of built wheels - CIBW_TEST_REQUIRES: numpy scipy pytest pytest-cov pytest-randomly flaky - - CIBW_TEST_COMMAND: python -m pytest --randomly-seed=137 {project}/thewalrus - - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - - CIBW_BUILD_VERBOSITY: 1 - -jobs: - linux-wheels-x86-64: - strategy: - matrix: - os: [ubuntu-latest] - arch: [x86_64] - name: ${{ matrix.arch }} - runs-on: ${{ matrix.os }} - - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.1 - with: - access_token: ${{ github.token }} - - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.9' - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==1.12.0 - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_ARCHS_LINUX: ${{matrix.arch}} - - - uses: kittaakos/upload-artifact-as-is@v0 - if: github.ref == 'refs/heads/master' - with: - path: ./wheelhouse/ diff --git a/.github/workflows/wheels_macos.yml b/.github/workflows/wheels_macos.yml deleted file mode 100644 index 6fbd09ed6..000000000 --- a/.github/workflows/wheels_macos.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Wheels MacOS -on: - push: - branches: - - master - pull_request: - -env: - CIBW_BUILD: 'cp37-* cp38-* cp39-*' - - # MacOS specific build settings - CIBW_BEFORE_ALL_MACOS: | - brew install gmp gcc libomp; - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install numpy==1.19.5 scipy cython - - # Testing of built wheels - CIBW_TEST_REQUIRES: numpy scipy pytest pytest-cov pytest-randomly flaky - - CIBW_TEST_COMMAND: | - python -m pytest --randomly-seed=137 {project}/thewalrus - - CIBW_BUILD_VERBOSITY: 1 - -jobs: - mac-wheels-x86: - strategy: - fail-fast: false - matrix: - os: [macos-11] - arch: [x86_64] - name: ${{ matrix.arch }} - runs-on: ${{ matrix.os }} - - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.1 - with: - access_token: ${{ github.token }} - - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.9' - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==1.12.0 - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_ARCHS_MACOS: ${{matrix.arch}} - - - uses: kittaakos/upload-artifact-as-is@v0 - if: github.ref == 'refs/heads/master' - with: - path: ./wheelhouse/ diff --git a/.github/workflows/wheels_win.yml b/.github/workflows/wheels_win.yml deleted file mode 100644 index 4e47399ed..000000000 --- a/.github/workflows/wheels_win.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Wheels Win -on: - push: - branches: - - master - pull_request: - -env: - CIBW_BUILD: 'cp37-* cp38-* cp39-*' - - # Python build settings - CIBW_BEFORE_BUILD: | - pip install numpy==1.19.5 scipy cython - - # Testing of built wheels - CIBW_TEST_REQUIRES: | - numpy scipy pytest pytest-cov pytest-randomly flaky - - CIBW_TEST_COMMAND: | - python -m pytest --randomly-seed=137 {project}/thewalrus - - CIBW_BUILD_VERBOSITY: 1 - -jobs: - win-wheels: - strategy: - matrix: - os: [windows-latest] - name: ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.1 - with: - access_token: ${{ github.token }} - - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.9' - - - name: Build wheels - uses: pypa/cibuildwheel@v1.12.0 - - - uses: kittaakos/upload-artifact-as-is@v0 - if: github.ref == 'refs/heads/master' - with: - path: ./wheelhouse/ diff --git a/README.rst b/README.rst index 32846dcad..4872334a6 100644 --- a/README.rst +++ b/README.rst @@ -1,13 +1,13 @@ The Walrus ########## -.. image:: https://circleci.com/gh/XanaduAI/thewalrus/tree/master.svg?style=svg - :alt: CircleCI - :target: https://circleci.com/gh/XanaduAI/thewalrus/tree/master +.. image:: https://github.com/XanaduAI/thewalrus/actions/workflows/tests.yml/badge.svg + :alt: Tests + :target: https://github.com/XanaduAI/thewalrus/actions/workflows/tests.yml -.. image:: https://ci.appveyor.com/api/projects/status/9udscqldo1xd25yk/branch/master?svg=true - :alt: Appveyor - :target: https://ci.appveyor.com/project/josh146/hafnian/branch/master +.. image:: https://github.com/XanaduAI/thewalrus/actions/workflows/build.yml/badge.svg + :alt: Build + :target: https://github.com/XanaduAI/thewalrus/actions/workflows/build.yml .. image:: https://img.shields.io/codecov/c/github/xanaduai/thewalrus/master.svg?style=flat :alt: Codecov coverage