Skip to content

Commit

Permalink
add workflow badges to README (#294)
Browse files Browse the repository at this point in the history
* 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 <theodor@xanadu.ai>

* Update URL on .github/ISSUE_TEMPLATE/feature_request.yaml

Co-authored-by: Theodor <theodor@xanadu.ai>

* Update URL .github/ISSUE_TEMPLATE/bug_report.yaml

Co-authored-by: Theodor <theodor@xanadu.ai>

* Apply suggestions from code review

Co-authored-by: Theodor <theodor@xanadu.ai>

* 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 <theodor@xanadu.ai>
  • Loading branch information
sduquemesa and thisac authored Nov 3, 2021
1 parent bdc050f commit a61c85d
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 179 deletions.
141 changes: 141 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Formatting check
name: format
on:
pull_request:
push:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: tests
on:
push:
branches:
Expand All @@ -7,7 +7,7 @@ on:

jobs:
python-tests:
name: Python tests
name: python
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
file: ./coverage.xml

cpp-tests:
name: C++ tests
name: c++
runs-on: ubuntu-latest

steps:
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/wheels_linux.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/wheels_macos.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/wheels_win.yml

This file was deleted.

12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a61c85d

Please sign in to comment.