Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub runner updates #388

Merged
merged 4 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/autodeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly)

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
Expand All @@ -39,7 +39,7 @@ jobs:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: ./.github/ci-scripts/before_install.sh

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

Expand All @@ -49,19 +49,19 @@ jobs:
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # doesn't work -- try using tags: above

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly)

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'

- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz

Expand All @@ -73,7 +73,7 @@ jobs:
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ jobs:
strategy:
fail-fast: false # Finish all tests even if one fails
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up installation environment (Ubuntu or Windows)
if: ${{matrix.os == 'ubuntu-20.04' || matrix.os == 'windows-2019'}}
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'}}
run: |
./.github/ci-scripts/before_install.sh
- name: Set up installation environment (MacOS)
if: ${{matrix.os == 'macos-11'}}
if: ${{matrix.os == 'macos-latest'}}
run: |
./.github/ci-scripts/before_install_macos.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }}
Expand All @@ -51,17 +51,17 @@ jobs:
python -m pip install -e .[testing]
python setup.py build_ext --inplace
- name: Run test_packages Ubuntu
if: ${{matrix.os == 'ubuntu-20.04'}}
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -v -n auto --dist loadscope --ignore=test/test_packages/mpi --ignore=test/test_packages/notebooks test/test_packages
- name: Run test_packages Windows
if: ${{matrix.os == 'windows-2019'}}
if: ${{matrix.os == 'windows-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -v -n auto --dist loadscope --ignore=test/test_packages/mpi --ignore=test/test_packages/notebooks test/test_packages
- name: Run test_packages MacOS
if: ${{matrix.os == 'macos-11'}}
if: ${{matrix.os == 'macos-latest'}}

run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/main-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build and run tests (MacOS only, all Python versions)

on:
push:
# Mac runners are expensive and oversubscribed. Only run on beta and master
branches: [ "beta", "master" ]
# Allow running manually from Actions tab
workflow_dispatch:

env:
SKIP_DEAP: 1

jobs:
build: # Main build + unit test check

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v4
- name: Set up installation environment (MacOS)
run: |
./.github/ci-scripts/before_install_macos.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }}
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install flake8
python -m pip install -e .[testing]
python setup.py build_ext --inplace
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately
- name: Lint with flake8
run: |
# Critical errors, exit on failure
flake8 . --count --show-source --statistics --config=.flake8-critical
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings
flake8 . --exit-zero --statistics
- name: Run unit tests MacOS
if: ${{matrix.os == 'macos-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit




72 changes: 72 additions & 0 deletions .github/workflows/main-minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build and run tests (no MacOS, low/high Python versions only)

on:
push:
# Intended to be fast checks on non-main branches
branches-ignore: [ "beta", "develop", "master" ]
# Hacky way to only run pull requests from forked repositories (assumes : is not used in branch names unless forked)
# https://github.saobby.my.eu.orgmunity/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/10
pull_request:
branches: [ "**:**" ]
# Allow running manually from Actions tab
workflow_dispatch:

env:
SKIP_DEAP: 1

jobs:
build: # Main build + unit test check

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.8,'3.11']

steps:
- uses: actions/checkout@v4
- name: Set up installation environment (Ubuntu or Windows)
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'}}
run: |
./.github/ci-scripts/before_install.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }}
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install flake8
python -m pip install -e .[testing]
python setup.py build_ext --inplace
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately
- name: Lint with flake8
if: ${{matrix.os != 'windows-latest'}}
run: |
# Critical errors, exit on failure
flake8 . --count --show-source --statistics --config=.flake8-critical
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings
flake8 . --exit-zero --statistics
- name: Run unit tests ubuntu
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
- name: Run unit tests windows
if: ${{matrix.os == 'windows-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit




33 changes: 11 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ name: Build and run tests

on:
push:
branches-ignore: [ "beta" ]
# Hacky way to only run pull requests from forked repositories (assumes : is not used in branch names unless forked)
# https://github.saobby.my.eu.orgmunity/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/10
branches: [ "develop", "master" ]
pull_request:
branches: [ "**:**" ]
# Allow running manually from Actions tab
Expand All @@ -22,25 +20,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up installation environment (Ubuntu or Windows)
if: ${{matrix.os == 'ubuntu-20.04' || matrix.os == 'windows-2019'}}
if: ${{matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'}}
run: |
./.github/ci-scripts/before_install.sh
- name: Set up installation environment (MacOS)
if: ${{matrix.os == 'macos-11'}}
run: |
./.github/ci-scripts/before_install_macos.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }}
Expand All @@ -53,39 +47,34 @@ jobs:
python setup.py build_ext --inplace
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately
- name: Lint with flake8
if: ${{matrix.os != 'windows-2019'}}
if: ${{matrix.os != 'windows-latest'}}
run: |
# Critical errors, exit on failure
flake8 . --count --show-source --statistics --config=.flake8-critical
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings
flake8 . --exit-zero --statistics
- name: Run unit tests ubuntu
if: ${{matrix.os == 'ubuntu-20.04'}}
if: ${{matrix.os == 'ubuntu-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
- name: Run unit tests windows
if: ${{matrix.os == 'windows-2019'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit
- name: Run unit tests MacOS
if: ${{matrix.os == 'macos-11'}}
if: ${{matrix.os == 'windows-latest'}}
run: |
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)"
python -m pytest -n auto --dist loadscope --cov=pygsti test/unit


push: # Push to stable "beta" branch on successful build

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Only run on "develop" branch if tests pass
needs: build
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PYGSTI_TOKEN }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/manualdeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly)

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
Expand All @@ -32,7 +32,7 @@ jobs:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: ./.github/ci-scripts/before_install.sh

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

Expand All @@ -41,27 +41,27 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly)

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'

- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
Loading