Skip to content

Commit e1d2b9b

Browse files
authored
infra: Consolidate GitHub actions (#323)
1 parent c6e7c9d commit e1d2b9b

File tree

9 files changed

+115
-154
lines changed

9 files changed

+115
-154
lines changed

.github/workflows/twine-check.yml renamed to .github/workflows/additional-pr-checks.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1-
name: Check long description for PyPI
1+
name: Additional pull request checks
22

33
on:
44
pull_request:
55
branches:
66
- main
77
- feature/**
88

9-
109
permissions:
1110
contents: read
1211

1312
jobs:
13+
check-code-format:
14+
name: Check code format
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
- name: Set up Python
19+
uses: actions/setup-python@v6
20+
with:
21+
python-version: "3.x"
22+
- name: Install dependencies
23+
run: |
24+
pip install tox
25+
- name: Run code format checks
26+
run: |
27+
tox -e linters_check
28+
1429
twine-check:
15-
name: Check long description
30+
name: Check PyPI long description
1631
runs-on: ubuntu-latest
1732
steps:
1833
- uses: actions/checkout@v6
1934
- name: Set up Python
2035
uses: actions/setup-python@v6
2136
with:
22-
python-version: '3.x'
37+
python-version: "3.x"
2338
- name: Install wheel
2439
run: python -m pip install --user --upgrade wheel
2540
- name: Install twine

.github/workflows/braket-latest-pl-stable.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/tutorials/build-and-test-code/python
3+
4+
name: Build
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
- feature/**
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
unit-tests:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
python-version: ["3.11", "3.12", "3.13"]
25+
26+
steps:
27+
- uses: actions/checkout@v6
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v6
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Maximize build space
33+
shell: bash
34+
run: |
35+
df -h
36+
if [ "$RUNNER_OS" != "Windows" ]; then
37+
sudo rm -rf /usr/share/dotnet &
38+
sudo rm -rf /usr/local/lib/android &
39+
sudo rm -rf /opt/ghc &
40+
sudo rm -rf /usr/local/share/boost
41+
fi
42+
df -h
43+
- name: Install dependencies
44+
run: |
45+
pip install tox
46+
- name: Check build space
47+
shell: bash
48+
run: |
49+
df -h
50+
- name: Run unit tests
51+
run: |
52+
tox -e unit-tests
53+
- name: Upload coverage report to Codecov
54+
uses: codecov/codecov-action@v5
55+
with:
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
if: ${{ strategy.job-index == 0 }}
58+
59+
pennylane-device-tests:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v6
63+
- name: Set up Python
64+
uses: actions/setup-python@v6
65+
with:
66+
python-version: "3.13"
67+
- name: Maximize build space
68+
shell: bash
69+
run: |
70+
df -h
71+
if [ "$RUNNER_OS" != "Windows" ]; then
72+
sudo rm -rf /usr/share/dotnet &
73+
sudo rm -rf /usr/local/lib/android &
74+
sudo rm -rf /opt/ghc &
75+
sudo rm -rf /usr/local/share/boost
76+
fi
77+
df -h
78+
- name: Install dependencies
79+
run: |
80+
pip install tox
81+
- name: Check build space
82+
shell: bash
83+
run: |
84+
df -h
85+
- name: Run PennyLane device integration tests
86+
run: |
87+
tox -e pennylane-device-tests

.github/workflows/check-format.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/pr-title-checker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "PR Title Checker"
1+
name: PR Title Checker
22

33
on:
44
push:
@@ -23,7 +23,7 @@ jobs:
2323
check:
2424
runs-on: ubuntu-latest
2525
steps:
26-
- name: "Check PR Title"
26+
- name: Check PR Title
2727
uses: thehanimo/pr-title-checker@v1.4.3
2828
with:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v6
2020
with:
21-
python-version: '3.x'
21+
python-version: "3.x"
2222
- name: Install wheel
2323
run: python -m pip install --user --upgrade wheel
2424
- name: Install twine

.github/workflows/python-package.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/stale_issue.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
name: "Close stale issues"
1+
name: Close stale issues
22

33
# Controls when the action will run.
44
# This is every day at 10am
55
on:
66
schedule:
77
- cron: "0 10 * * *"
88

9-
109
permissions:
1110
issues: write
1211
pull-requests: write
1312

1413
jobs:
1514
cleanup:
1615
runs-on: ubuntu-latest
17-
name: Stale issue job
1816
steps:
19-
- uses: aws-actions/stale-issue-cleanup@v6
17+
- uses: aws-actions/stale-issue-cleanup@v7.1.0
2018
with:
2119
# Setting messages to an empty string will cause the automation to skip
2220
# that category
@@ -26,9 +24,9 @@ jobs:
2624

2725
# These labels are required
2826
stale-issue-label: closing-soon
29-
exempt-issue-label: auto-label-exempt
27+
exempt-issue-labels: auto-label-exempt
3028
stale-pr-label: closing-soon
31-
exempt-pr-label: pr/needs-review
29+
exempt-pr-labels: pr/needs-review
3230
response-requested-label: response-requested
3331

3432
# Don't set closed-for-staleness label to skip closing very old issues

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Amazon Braket PennyLane Plugin
77
.. image:: https://img.shields.io/pypi/pyversions/amazon-braket-pennylane-plugin.svg
88
:alt: Supported Python Versions
99
:target: https://pypi.python.org/pypi/amazon-braket-pennylane-plugin
10-
.. image:: https://img.shields.io/github/actions/workflow/status/amazon-braket/amazon-braket-pennylane-plugin-python/python-package.yml?branch=main&logo=github
10+
.. image:: https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python/actions/workflows/build.yml/badge.svg
1111
:alt: Build Status
12-
:target: https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python/actions?query=workflow%3A%22Python+package%22
12+
:target: https://github.com/amazon-braket/amazon-braket-pennylane-plugin-python/actions/workflows/build.yml
1313
.. image:: https://codecov.io/gh/amazon-braket/amazon-braket-pennylane-plugin-python/branch/main/graph/badge.svg?token=VPPM8BJKW4
1414
:alt: codecov
1515
:target: https://codecov.io/gh/amazon-braket/amazon-braket-pennylane-plugin-python

0 commit comments

Comments
 (0)