From 2d0d93cc01d26d1d0eaca9e3431be8b29f25334a Mon Sep 17 00:00:00 2001 From: Florent Valette Date: Mon, 15 Jul 2024 15:25:21 +0200 Subject: [PATCH 1/3] workflows: split main in specific workflow --- .github/workflows/doc.yml | 25 +++++++++++++++++++++++++ .github/workflows/lint.yml | 25 +++++++++++++++++++++++++ .github/workflows/quality.yml | 22 ++++++++++++++++++++++ .github/workflows/unittest.yml | 31 +++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 .github/workflows/doc.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/quality.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..6c7d049 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2024 Ledger SAS +# +# SPDX-License-Identifier: Apache-2.0 + +name: Python Doc + +on: + push: + branches: + - main + paths: + - 'doc/**' + - 'tox.ini' + - '.github/workflows/doc.yml' + pull_request: + paths: + - 'doc/**' + - 'tox.ini' + - '.github/workflows/doc.yml' + +jobs: + doc: + uses: outpost-os/pipeline-python/.github/workflows/doc.yml@v1 + with: + python-version: '3.10' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c8b03e8 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2024 Ledger SAS +# +# SPDX-License-Identifier: Apache-2.0 + +name: Python Lint + +on: + push: + branches: + - main + paths: + - 'src/**' + - 'tox.ini' + - '.github/workflows/lint.yml' + pull_request: + paths: + - 'src/**' + - 'tox.ini' + - '.github/workflows/lint.yml' + +jobs: + lint: + uses: outpost-os/pipeline-python/.github/workflows/lint.yml@v1 + with: + python-version: '3.10' diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..35a8a63 --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2024 Ledger SAS +# +# SPDX-License-Identifier: Apache-2.0 + +name: Python Code Quality + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + codeql: + permissions: + security-events: write + packages: read + actions: read + contents: read + uses: outpost-os/pipeline-python/.github/workflows/codeql.yml@v1 diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..a436bdd --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: 2024 Ledger SAS +# +# SPDX-License-Identifier: Apache-2.0 + +name: Python Unit Tests + +on: + push: + branches: + - main + paths: + - 'src/**' + - 'tests/**' + - 'tox.ini' + - '.github/workflows/unittest.yml' + pull_request: + paths: + - 'src/**' + - 'tests/**' + - 'tox.ini' + - '.github/workflows/unittest.yml' + +jobs: + unittest: + strategy: + matrix: + version: ['3.10', '3.11', '3.12'] + uses: outpost-os/pipeline-python/.github/workflows/unittest.yml@v1 + with: + python-version: ${{ matrix.version }} + secrets: inherit From d87209e0bcf2e9bb4b64dc441eac7ccf9b2097ea Mon Sep 17 00:00:00 2001 From: Florent Valette Date: Mon, 15 Jul 2024 15:25:50 +0200 Subject: [PATCH 2/3] workflows: remove main workflow --- .github/workflows/main.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ecc7f15..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-FileCopyrightText: 2024 Ledger SAS -# -# SPDX-License-Identifier: Apache-2.0 - -on: - push: - pull_request: - branches: - - main - -jobs: - ut: - strategy: - matrix: - version: ['3.10', '3.11', '3.12'] - uses: outpost-os/pipeline-python/.github/workflows/unittest.yml@v1 - with: - python-version: ${{ matrix.version }} - secrets: inherit - doc: - uses: outpost-os/pipeline-python/.github/workflows/doc.yml@v1 - with: - python-version: '3.11' - lint: - needs: [ ut, doc ] - if: ${{ github.event_name == 'pull_request' }} - uses: outpost-os/pipeline-python/.github/workflows/lint.yml@v1 - with: - python-version: '3.10' - codeql: - needs: [ ut ] - permissions: - security-events: write - packages: read - actions: read - contents: read - uses: outpost-os/pipeline-python/.github/workflows/codeql.yml@v1 From a879d3d1bb5f5f622f66af9b34adfd14a4013674 Mon Sep 17 00:00:00 2001 From: Florent Valette Date: Mon, 15 Jul 2024 15:26:13 +0200 Subject: [PATCH 3/3] README: update workflows badges --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bb4a51..dcf018d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,10 @@ SPDX-License-Identifier: Apache-2.0 ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dts-utils) [![codecov](https://codecov.io/gh/outpost-os/python-dts-utils/graph/badge.svg?token=SGQPBE40UI)](https://codecov.io/gh/outpost-os/python-dts-utils) -![build](https://github.com/outpost-os/python-dts-utils/actions/workflows/main.yml/badge.svg) +![lint](https://github.com/outpost-os/python-dts-utils/actions/workflows/lint.yml/badge.svg) +![unittest](https://github.com/outpost-os/python-dts-utils/actions/workflows/unittest.yml/badge.svg) +![doc](https://github.com/outpost-os/python-dts-utils/actions/workflows/doc.yml/badge.svg) +![quality](https://github.com/outpost-os/python-dts-utils/actions/workflows/quality.yml/badge.svg) # dts-utils python package `dts-utils` is an utility python package that aims to ease dts handling in python and source code