Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Apr 19, 2024
1 parent 61d0157 commit 2730f62
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/modoboa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -153,28 +153,33 @@ 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

release:
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: |
Expand All @@ -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 change: 1 addition & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_silent(self):
self.dbport,
self.projname,
)
print(dburl)
cmd = (
"modoboa-admin.py deploy --collectstatic "
"--dburl %s --domain %s --admin-username admin %s"
Expand Down

0 comments on commit 2730f62

Please sign in to comment.