-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QI2-1220] Call composite actions and workflows (#91)
- Loading branch information
Showing
3 changed files
with
16 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,110 +7,14 @@ on: | |
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 | ||
e2e-test: | ||
name: End to End testing | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
backend-name: | ||
- "Stubbed" | ||
- "QX emulator" | ||
env: | ||
E2E_USERNAME: ${{ secrets.E2E_USERNAME }} | ||
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v3 | ||
with: | ||
poetry-version: "1.3.2" | ||
- name: Install packages | ||
run: poetry install | ||
- name: Run e2e test | ||
run: poetry run python tests/e2e_test.py "${{ matrix.backend-name }}" | ||
complete: | ||
# see https://github.community/t/status-check-for-a-matrix-jobs/127354/7 | ||
name: Report status | ||
needs: [lint, unit-test, e2e-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: complete | ||
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/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
merge-method: squash | ||
testing: | ||
uses: qutech-delft/github-actions/.github/workflows/poetry-tests.yaml@master | ||
with: | ||
e2e_path: 'tests/e2e_test.py' | ||
idp_url: 'https://quantum-inspire-staging.eu.auth0.com' | ||
default_host: 'https://staging.qi2.quantum-inspire.com' | ||
api_audience: 'compute-job-manager' | ||
secrets: | ||
e2e_username: ${{ secrets.E2E_USERNAME }} | ||
e2e_password: ${{ secrets.E2E_PASSWORD }} | ||
idp_client_id: ${{ secrets.IDP_CLIENT_ID }} |