From 5a2d6c23fc13d899174add02a12d4821eeabc663 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 15 Jan 2025 18:10:40 +0100 Subject: [PATCH 01/10] ci: Point test workflows to working branch --- .github/workflows/rules.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rules.yml b/.github/workflows/rules.yml index cac9eaf99..16e747cf3 100644 --- a/.github/workflows/rules.yml +++ b/.github/workflows/rules.yml @@ -13,7 +13,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11", "3.12"] - uses: qiboteam/workflows/.github/workflows/rules-poetry.yml@v1 + uses: qiboteam/workflows/workflows/test.yml@to-actions with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} From 2972afa986cad6b1eabcab4a5ca142a697b73c7c Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 15 Jan 2025 18:21:06 +0100 Subject: [PATCH 02/10] ci: Scope reusable workflow again in .github folder --- .github/workflows/rules.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rules.yml b/.github/workflows/rules.yml index 16e747cf3..aac60d70c 100644 --- a/.github/workflows/rules.yml +++ b/.github/workflows/rules.yml @@ -13,7 +13,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11", "3.12"] - uses: qiboteam/workflows/workflows/test.yml@to-actions + uses: qiboteam/workflows/.github/workflows/test.yml@to-actions with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} From 9a02b49ad4477df14bac3e68b8fe486c0cc3ff1b Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 14:24:07 +0100 Subject: [PATCH 03/10] build: Add empty task as a placeholder for typechecking --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1cf8e2a79..0a558f2c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,6 +102,7 @@ lint-warnings = """ --select F,E,W,C90,N,UP,BLE,FBT,B,A,C4,T10,EM,EXE,ISC,ICN,LOG,G,INP,PIE,T20,PT,Q,RSE,\ RET,SLF,SLOT,SIM,TC,INT,ARG,PTH,ERA,NPY,PERF,RUF """ +types = "true" docs = "make -C doc html" docs-clean = "make -C doc clean" test-docs = "make -C doc doctest" From cfe59ff20c9fc9ae0174c2a134b6d929e54d47bc Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 16:23:51 +0100 Subject: [PATCH 04/10] ci: Update workflows branch for rules --- .github/workflows/rules.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rules.yml b/.github/workflows/rules.yml index aac60d70c..d0d2d5a39 100644 --- a/.github/workflows/rules.yml +++ b/.github/workflows/rules.yml @@ -13,7 +13,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11", "3.12"] - uses: qiboteam/workflows/.github/workflows/test.yml@to-actions + uses: qiboteam/workflows/.github/workflows/test.yml@analysis with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} From b906ed88a17386018478df965264e4c4e5257578 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 17:06:06 +0100 Subject: [PATCH 05/10] ci: Update all workflows to v2 --- .github/workflows/{publish.yml => docs.yml} | 5 ++--- .github/workflows/{rules.yml => test.yml} | 5 ++--- .github/workflows/{deploy.yml => wheels.yml} | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) rename .github/workflows/{publish.yml => docs.yml} (85%) rename .github/workflows/{rules.yml => test.yml} (78%) rename .github/workflows/{deploy.yml => wheels.yml} (78%) diff --git a/.github/workflows/publish.yml b/.github/workflows/docs.yml similarity index 85% rename from .github/workflows/publish.yml rename to .github/workflows/docs.yml index 45dc33172..27ae922d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/docs.yml @@ -28,11 +28,10 @@ jobs: deploy-docs: needs: [evaluate-label] - uses: qiboteam/workflows/.github/workflows/deploy-ghpages-latest-stable.yml@v1 + uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 with: - python-version: '3.10' + python-version: "3.11" package-manager: "poetry" - dependency-path: "**/poetry.lock" trigger-label: "${{needs.evaluate-label.outputs.label}}" project: qibolab poetry-extras: --with docs --all-extras diff --git a/.github/workflows/rules.yml b/.github/workflows/test.yml similarity index 78% rename from .github/workflows/rules.yml rename to .github/workflows/test.yml index d0d2d5a39..d9dfcd069 100644 --- a/.github/workflows/rules.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,3 @@ -# A single CI script with github workflow name: tests on: @@ -13,10 +12,10 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11", "3.12"] - uses: qiboteam/workflows/.github/workflows/test.yml@analysis + uses: qiboteam/workflows/.github/workflows/test.yml@v2 with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - doctests: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version != '3.12'}} + doctests: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version != '3.11'}} poetry-extras: "--with docs,tests,analysis --all-extras" secrets: inherit diff --git a/.github/workflows/deploy.yml b/.github/workflows/wheels.yml similarity index 78% rename from .github/workflows/deploy.yml rename to .github/workflows/wheels.yml index c1ee242da..57b0ab9dc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/wheels.yml @@ -1,4 +1,3 @@ -# A single CI script with github workflow name: Build wheels on: @@ -13,10 +12,10 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11", "3.12"] - uses: qiboteam/workflows/.github/workflows/deploy-pip-poetry.yml@v1 + uses: qiboteam/workflows/.github/workflows/wheels.yml@v2 with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - publish: ${{ github.event_name == 'release' && github.event.action == 'published' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }} + publish: ${{ github.event_name == 'release' && github.event.action == 'published' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} poetry-extras: "--with docs,tests,analysis --all-extras" secrets: inherit From 4341be6ff04d525aff6fb941cadc40db179a5d18 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 19:05:31 +0100 Subject: [PATCH 06/10] ci: Attempt migrating evaluate-label to a reusable action --- .github/workflows/docs.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 27ae922d7..d9de43e78 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,30 +8,21 @@ on: - "*" jobs: - evaluate-label: + version: runs-on: ubuntu-latest outputs: - label: ${{ steps.label_step.outputs.version}} + version: ${{ steps.classify.outputs.version}} + steps: - - name: checks for the label - id: label_step - run: | - if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then - echo "version=latest" >> $GITHUB_OUTPUT - fi - if [[ "${{ github.ref_type }}" == "branch" ]] && [[ "${{ github.ref }}" != "refs/heads/main" ]]; then - exit 1 - fi - if [[ "${{ github.ref_type }}" == "tag" ]]; then - echo "version=stable" >> $GITHUB_OUTPUT - fi + - id: classify + uses: qiboteam/workflows/actions/docs/version@evaluate-label deploy-docs: - needs: [evaluate-label] + needs: [version] uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 with: python-version: "3.11" package-manager: "poetry" - trigger-label: "${{needs.evaluate-label.outputs.label}}" + trigger-label: "${{needs.version.outputs.label}}" project: qibolab poetry-extras: --with docs --all-extras From 9591846995073463752d0048c75ef91d3d5ab98e Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 19:10:18 +0100 Subject: [PATCH 07/10] ci: Remove deprecated package manager input Assume Poetry --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d9de43e78..55e48f208 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,6 @@ jobs: uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 with: python-version: "3.11" - package-manager: "poetry" trigger-label: "${{needs.version.outputs.label}}" project: qibolab poetry-extras: --with docs --all-extras From b7bc779481de2ca27f49c4f29225c46b24c8ec1a Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 19:07:08 +0100 Subject: [PATCH 08/10] chore: Temporary switch back workflow file name To allow manual dispatch --- .github/workflows/{docs.yml => publish.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docs.yml => publish.yml} (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/publish.yml similarity index 100% rename from .github/workflows/docs.yml rename to .github/workflows/publish.yml From 88bc6de3b8da1ec1905356813c2c0b7e0ae7dbc4 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 19:14:02 +0100 Subject: [PATCH 09/10] ci: Add debug print to test new action --- .github/workflows/publish.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 55e48f208..bdb1ea038 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,11 +17,18 @@ jobs: - id: classify uses: qiboteam/workflows/actions/docs/version@evaluate-label - deploy-docs: + test: + runs-on: ubuntu-latest needs: [version] - uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 - with: - python-version: "3.11" - trigger-label: "${{needs.version.outputs.label}}" - project: qibolab - poetry-extras: --with docs --all-extras + + steps: + - run: echo ${{needs.version.outputs.version}} + + # deploy-docs: + # needs: [version] + # uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 + # with: + # python-version: "3.11" + # trigger-label: "${{needs.version.outputs.version}}" + # project: qibolab + # poetry-extras: --with docs --all-extras From a261290248109ba18ffd3e26a911a0bfe671fde2 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 16 Jan 2025 19:23:12 +0100 Subject: [PATCH 10/10] ci: Restore docs workflow --- .github/workflows/docs.yml | 27 +++++++++++++++++++++++++++ .github/workflows/publish.yml | 34 ---------------------------------- 2 files changed, 27 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..7bcfe0ae9 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,27 @@ +name: docs + +on: + workflow_dispatch: + push: + branches: [main] + tags: + - "*" + +jobs: + version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.classify.outputs.version}} + + steps: + - id: classify + uses: qiboteam/workflows/actions/docs/version@v2 + + deploy-docs: + needs: [version] + uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 + with: + python-version: "3.11" + trigger-label: "${{needs.version.outputs.version}}" + project: qibolab + poetry-extras: --with docs --all-extras diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index bdb1ea038..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: docs - -on: - workflow_dispatch: - push: - branches: [main] - tags: - - "*" - -jobs: - version: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.classify.outputs.version}} - - steps: - - id: classify - uses: qiboteam/workflows/actions/docs/version@evaluate-label - - test: - runs-on: ubuntu-latest - needs: [version] - - steps: - - run: echo ${{needs.version.outputs.version}} - - # deploy-docs: - # needs: [version] - # uses: qiboteam/workflows/.github/workflows/latest-stable.yml@v2 - # with: - # python-version: "3.11" - # trigger-label: "${{needs.version.outputs.version}}" - # project: qibolab - # poetry-extras: --with docs --all-extras