Updated workflow

This commit is contained in:
Antoine Nguyen
2024-06-22 19:45:17 +02:00
committed by Spitfireap
parent ec6e06b716
commit c3c0885381
2 changed files with 21 additions and 19 deletions
+20 -19
View File
@@ -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
+1
View File
@@ -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"