Skip to content

Commit a80c88d

Browse files
Merge pull request #2 from OpenQuantumDesign/tests-actions
Add Github actions, move to pytest, add templates
2 parents d95ac09 + 29a3dad commit a80c88d

26 files changed

Lines changed: 235 additions & 138 deletions

.github/ISSUE_TEMPLATE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
* **I'm submitting a ...**
2+
- [ ] bug report
3+
- [ ] feature request
4+
5+
6+
* **What is the current behavior?**
7+
8+
9+
10+
* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem**
11+
12+
13+
14+
* **What is the expected behavior?**
15+
16+
17+
18+
* **What is the motivation / use case for changing the behavior?**
19+
20+
21+
22+
* **Please tell us about your environment:**
23+
24+
- Version:
25+
- Platform:
26+
- Subsystem:
27+
28+
29+
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
* **Please check if the PR fulfills these requirements**
2+
- [ ] The commit message follows our guidelines
3+
- [ ] Tests for the changes have been added (for bug fixes / features)
4+
- [ ] Docs have been added / updated (for bug fixes / features)
5+
6+
7+
* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
8+
9+
10+
11+
* **What is the current behavior?** (You can also link to an open issue here)
12+
13+
14+
15+
* **What is the new behavior (if this is a feature change)?**
16+
17+
18+
19+
* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)
20+
21+
22+
23+
* **Other information**:
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
name: Check Code Format
1+
name: Ruff Static Code Analysis
22

33
on: pull_request
44

55
jobs:
6-
lint:
6+
ruff_static_code_analysis:
7+
name: Ruff Static Code Analysis
78
runs-on: ubuntu-latest
89
steps:
910
- uses: actions/checkout@v3
10-
- uses: psf/black@stable
11+
- uses: astral-sh/ruff-action@v2
1112
with:
12-
options: "--check --verbose"
1313
src: "./src"
14-
jupyter: true
15-
version: "~= 24.0"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Copyright Header Check
2+
3+
on: pull_request
4+
5+
jobs:
6+
copyright_header_check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Check license & copyright headers
11+
uses: viperproject/check-license-header@v2
12+
with:
13+
path:
14+
config: .github/workflows/check_copyright_config.json
15+
# strict: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
{
3+
"include": [
4+
"src/**",
5+
"tests/**"
6+
],
7+
"exclude": [
8+
"docs/**",
9+
"**/*.ini"
10+
],
11+
"license": ".github/workflows/copyright.txt"
12+
}
13+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check Mkdocs Build
2+
3+
on: pull_request
4+
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-python@v5
11+
with:
12+
python-version: 3.12
13+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
14+
- uses: actions/cache@v3
15+
with:
16+
key: mkdocs-material-${{ env.cache_id }}
17+
path: .cache
18+
restore-keys: |
19+
mkdocs-material-
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v4
22+
# - run: cp -r examples/ docs/examples/
23+
- run: uv pip install .[docs] --system
24+
- run: mkdocs build

.github/workflows/copyright.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2024-2025 Open Quantum Design
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

.github/workflows/pytest.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
41
name: CI
52

63
on:
74
push:
85
branches: ["main"]
96
pull_request:
107
branches: ["main"]
8+
workflow_dispatch:
119

1210
permissions:
1311
contents: read
@@ -21,23 +19,28 @@ jobs:
2119
- "3.10"
2220
- "3.11"
2321
- "3.12"
24-
os:
25-
- ubuntu-latest
22+
- "3.13"
23+
24+
os: [ubuntu-latest, windows-latest, macos-latest]
2625
arch:
2726
- x64
2827
name: Python ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
29-
runs-on: ${{ matrix.os }}
28+
3029
steps:
3130
- uses: actions/checkout@v4
3231
- name: Set up Python
3332
uses: actions/setup-python@v4
3433
with:
3534
python-version: ${{ matrix.version }}
3635
cache: "pip"
37-
- name: Install dependencies
38-
run: |
39-
python -m pip install --upgrade pip
40-
pip install .[server]
41-
- name: Run unittest
42-
run: |
43-
python -m unittest discover tests -v
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v4
39+
with:
40+
enable-cache: true
41+
42+
- name: Install the project
43+
run: uv pip install .[tests]
44+
45+
- name: Run tests
46+
run: uv run pytest tests

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,6 @@ cython_debug/
163163

164164
*.sublime-*
165165
*.code-workspace
166-
.github/workflows/_*.yml
166+
.github/workflows/_*.yml
167+
168+
uv.lock

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
Open Quantum Design: Cloud
55
</h2>
66

7-
[![doc](https://img.shields.io/badge/documentation-lightblue)](https://docs.openquantumdesign.org/open-quantum-design-cloud)
7+
[![docs](https://img.shields.io/badge/documentation-lightblue)](https://docs.openquantumdesign.org/open-quantum-design-cloud)
88
[![PyPI Version](https://img.shields.io/pypi/v/oqd-cloud)](https://pypi.org/project/oqd-cloud)
99
[![CI](https://github.com/OpenQuantumDesign/oqd-cloud/actions/workflows/pytest.yml/badge.svg)](https://github.com/OpenQuantumDesign/oqd-cloud/actions/workflows/pytest.yml)
1010
![versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)
11-
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
1211
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](https://opensource.org/licenses/Apache-2.0)
12+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1313

1414

1515

0 commit comments

Comments
 (0)