diff --git a/.github/workflows/docs.yml b/.github/workflows/_docs.yml similarity index 90% rename from .github/workflows/docs.yml rename to .github/workflows/_docs.yml index 6eed5fe9..17b5aac6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/_docs.yml @@ -4,10 +4,7 @@ name: Publish Documentation on: - release: - types: [ published ] - - # Allows running this workflow manually from the Actions tab + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/publish.yml b/.github/workflows/_publish.yml similarity index 93% rename from .github/workflows/publish.yml rename to .github/workflows/_publish.yml index b29cc7d7..3e881237 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/_publish.yml @@ -4,10 +4,7 @@ name: Publish on: - release: - types: [ published ] - - # Allows running this workflow manually from the Actions tab + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/linting.yml b/.github/workflows/_static-analysis.yml similarity index 83% rename from .github/workflows/linting.yml rename to .github/workflows/_static-analysis.yml index 23987a69..f734f82f 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/_static-analysis.yml @@ -4,7 +4,7 @@ name: Static Analysis on: - - push + workflow_call: jobs: static-check: @@ -30,9 +30,17 @@ jobs: ${{ runner.os }}-lint- - name: Install dependencies - # We install the full dev requirements to make sure everything installs OK run: | python -m pip install pip + pip install pylic~=3.6.1 + pip install -e . + + - name: License check + run: | + pylic check --allow-extra-safe-licenses + + - name: Install lint dependencies + run: | pip install -e .[lint] - name: Cache pre-commit diff --git a/.github/workflows/sync-readme.yml b/.github/workflows/_sync-readme.yml similarity index 82% rename from .github/workflows/sync-readme.yml rename to .github/workflows/_sync-readme.yml index 32579338..4528a33f 100644 --- a/.github/workflows/sync-readme.yml +++ b/.github/workflows/_sync-readme.yml @@ -1,11 +1,8 @@ name: Sync `documentation` directory to ReadMe -# Run workflow for every push to the `main` branch on: + workflow_call: workflow_dispatch: - release: - branches: - - main jobs: sync: diff --git a/.github/workflows/test-code-samples.yml b/.github/workflows/_test-code-samples.yml similarity index 92% rename from .github/workflows/test-code-samples.yml rename to .github/workflows/_test-code-samples.yml index 52585fb7..7bd17624 100644 --- a/.github/workflows/test-code-samples.yml +++ b/.github/workflows/_test-code-samples.yml @@ -1,11 +1,7 @@ name: Test Code Samples on: - pull_request: - schedule: - - cron: '0 0 * * *' - - # Allow running this workflow manually from the Actions tab + workflow_call: workflow_dispatch: jobs: diff --git a/.github/workflows/test-integration.yml b/.github/workflows/_test-integrations.yml similarity index 93% rename from .github/workflows/test-integration.yml rename to .github/workflows/_test-integrations.yml index 37ae9d0c..8acca249 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/_test-integrations.yml @@ -4,11 +4,7 @@ name: Integration Test on: - pull_request: - workflow_run: - workflows: ["Test Code Samples"] - types: - - completed + workflow_call: jobs: pytest: diff --git a/.github/workflows/test-regression.yml b/.github/workflows/_test-regressions.yml similarity index 93% rename from .github/workflows/test-regression.yml rename to .github/workflows/_test-regressions.yml index 256fee75..ba21ea84 100644 --- a/.github/workflows/test-regression.yml +++ b/.github/workflows/_test-regressions.yml @@ -4,12 +4,8 @@ name: Regression Test on: - pull_request: + workflow_call: workflow_dispatch: - workflow_run: - workflows: ["Test Code Samples"] - types: - - completed jobs: pytest: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/_test-units.yml similarity index 96% rename from .github/workflows/unit-test.yml rename to .github/workflows/_test-units.yml index f45c1e25..5d625e88 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/_test-units.yml @@ -4,11 +4,11 @@ name: Test on: - - push + workflow_call: jobs: pytest: - name: Run Tests + name: Run Unit Tests timeout-minutes: 30 strategy: matrix: diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml new file mode 100644 index 00000000..33066589 --- /dev/null +++ b/.github/workflows/cron.yml @@ -0,0 +1,13 @@ +name: Crontab + +on: + schedule: + - cron: '33 0 * * *' + +jobs: + test_regressions: + uses: mindee/mindee-api-python/.github/workflows/_test-regressions.yml@main + secrets: inherit + test_code_samples: + uses: mindee/mindee-api-python/.github/workflows/_test-code-samples.yml@main + secrets: inherit diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml deleted file mode 100644 index 268d6cc7..00000000 --- a/.github/workflows/license.yml +++ /dev/null @@ -1,41 +0,0 @@ -# -# Make sure dependencies use compatible licenses. -# -name: License Check - -on: - - pull_request - -jobs: - license-check: - name: Check Licenses - runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - matrix: - python-version: ["3.11"] - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-lic-${{ hashFiles('**/pyproject.toml') }} - restore-keys: | - ${{ runner.os }}-lic- - - - name: Install dependencies - run: | - python -m pip install pip - pip install pylic~=3.6.1 - pip install -e . - - - name: License check - run: | - pylic check --allow-extra-safe-licenses diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 00000000..4601e084 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,17 @@ +name: Publish Release + +on: + release: + types: [ published ] + +jobs: + docs-publish: + uses: mindee/mindee-api-python/.github/workflows/_docs.yml@main + secrets: inherit + sync-readme: + uses: mindee/mindee-api-python/.github/workflows/_sync-readme.yml@main + needs: docs-publish + secrets: inherit + maven-publish: + uses: mindee/mindee-api-python/.github/workflows/_publish.yml@main + secrets: inherit diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000..b17060c5 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,24 @@ +name: Pull Request + +on: + pull_request: + +jobs: + static_analysis: + uses: mindee/mindee-api-python/.github/workflows/_static-analysis.yml@main + test_units: + uses: mindee/mindee-api-python/.github/workflows/_test-units.yml@main + needs: static_analysis + secrets: inherit + test_regressions: + uses: mindee/mindee-api-python/.github/workflows/_test-regressions.yml@main + needs: test_units + secrets: inherit + test_integrations: + uses: mindee/mindee-api-python/.github/workflows/_test-integrations.yml@main + needs: test_units + secrets: inherit + test_code_samples: + uses: mindee/mindee-api-python/.github/workflows/_test-code-samples.yml@main + needs: test_units + secrets: inherit diff --git a/.github/workflows/push-main-branch.yml b/.github/workflows/push-main-branch.yml new file mode 100644 index 00000000..2f5b5ab8 --- /dev/null +++ b/.github/workflows/push-main-branch.yml @@ -0,0 +1,17 @@ +name: Push Main Branch + +on: + push: + branches: + - main + +jobs: + lint: + uses: mindee/mindee-api-python/.github/workflows/_lint.yml@main + test_units: + uses: mindee/mindee-api-python/.github/workflows/_test-units.yml@main + needs: lint + secrets: inherit + tag: + uses: mindee/client-lib-actions/.github/workflows/tag-version.yml@main + needs: build diff --git a/.github/workflows/tag-version.yml b/.github/workflows/tag-version.yml deleted file mode 100644 index 31194379..00000000 --- a/.github/workflows/tag-version.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Tag Version - -on: - push: - branches: - - main - -jobs: - tag: - uses: mindee/client-lib-actions/.github/workflows/tag-version.yml@main diff --git a/pyproject.toml b/pyproject.toml index d8a5fc79..d4cdaa52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,7 @@ safe_licenses = [ "MIT License", "Mozilla Public License 2.0 (MPL 2.0)", "BSD License", - "(Apache-2.0 OR BSD-3-Clause) AND LicenseRef-PdfiumThirdParty", + "BSD-3-Clause, Apache-2.0, PdfiumThirdParty", "Historical Permission Notice and Disclaimer (HPND)", "CMU License (MIT-CMU)", ]