Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

[QI2-1095] Set up repository #1

Merged
merged 1 commit into from
Oct 9, 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
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

# Override for python
[*.py]
indent_style = space
indent_size = 4

# Override for yaml files
[*.{yaml,yml}]
indent_size = 2

# Override for markdown
[*.{md}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
reviewers:
- QuTech-Delft/web-team
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "opensquirrel"
versions: ["*"]
- dependency-name: "pennylane"
versions: ["*"]
- dependency-name: "qi-compute-api-client"
versions: ["*"]
reviewers:
- QuTech-Delft/web-team
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Releases

on:
release:
types:
- created

jobs:
publish:
name: Publish to TestPyPI
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.3.2"
- name: Version poetry package
run: poetry version "${{ github.ref_name }}"
- name: Build poetry package
run: poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
91 changes: 91 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Tests

on:
push:
branches:
- dev
pull_request:

jobs:
lint:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.3.2"
- name: Install tox
run: pip install tox
- name: run tox lint and type
run: tox -e lint,type
unit-test:
name: Unit testing
needs: lint
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-13 # runs x64
- macos-14 # runs arm64
- windows-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}
env:
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.3.2"
- name: Install tox
run: pip install tox
- name: run tox test
run: tox -e test
complete:
# see https://github.community/t/status-check-for-a-matrix-jobs/127354/7
name: Report status
needs: [lint, unit-test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check all job status
# see https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
run: exit 1
auto-merge-dependabot:
name: Auto merge dependabot PR
needs: [lint, unit-test]
if: ${{ (github.event_name == 'pull_request') && (github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Squash and Merge PR from dependabot
uses: fastify/github-action-merge-dependabot@v3.10.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: squash

Loading