From c3c0885381db00730b9c70f91ea00aca20486ce6 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Fri, 19 Apr 2024 10:19:14 +0200 Subject: [PATCH] Updated workflow --- .github/workflows/modoboa.yml | 39 ++++++++++++++++++----------------- tests.py | 1 + 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/modoboa.yml b/.github/workflows/modoboa.yml index 8f45f6e61..3767b2f33 100644 --- a/.github/workflows/modoboa.yml +++ b/.github/workflows/modoboa.yml @@ -75,9 +75,9 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -124,7 +124,7 @@ jobs: LDAP_SERVER_PORT: ${{ job.services.openldap.ports[389] }} - name: Test with pytest and coverage - if: ${{ matrix.python-version == '3.10' && matrix.database == 'postgres' }} + if: ${{ matrix.python-version == '3.11' && matrix.database == 'postgres' }} run: | python ./tests.py cd test_project @@ -143,8 +143,8 @@ jobs: REDIS_PORT: ${{ job.services.redis.ports[6379] }} LDAP_SERVER_PORT: ${{ job.services.openldap.ports[389] }} - name: Upload coverage result - if: ${{ matrix.python-version == '3.10' && matrix.database == 'postgres' }} - uses: actions/upload-artifact@v3 + if: ${{ matrix.python-version == '3.11' && matrix.database == 'postgres' }} + uses: actions/upload-artifact@v5 with: name: coverage-results path: test_project/coverage.xml @@ -153,13 +153,13 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download coverage results - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: coverage-results - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./coverage.xml @@ -167,14 +167,19 @@ jobs: if: github.event_name != 'pull_request' needs: coverage runs-on: ubuntu-latest + permissions: + id-token: write + environment: + name: pypi + url: https://pypi.org/p/modoboa steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python 3.10 - uses: actions/setup-python@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - name: Build frontend shell: bash -l {0} run: | @@ -198,14 +203,10 @@ jobs: if: endsWith(github.event.ref, '/master') uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.test_pypi_password }} - repository_url: https://test.pypi.org/legacy/ - skip_existing: true + repository-url: https://test.pypi.org/legacy/ + skip-existing: true - name: Publish distribution to PyPI if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.pypi_password }} - skip_existing: true + skip-existing: true diff --git a/tests.py b/tests.py index 8cd13cbdb..dd7e9c022 100644 --- a/tests.py +++ b/tests.py @@ -33,6 +33,7 @@ class DeployTest(unittest.TestCase): self.dbport, self.projname, ) + print(dburl) cmd = ( "modoboa-admin.py deploy --collectstatic " "--dburl %s --domain %s --admin-username admin %s"