From 7b1c8caa375116a87053dc2215129568e684a352 Mon Sep 17 00:00:00 2001 From: Jens Diemer Date: Tue, 18 Jun 2024 20:12:47 +0200 Subject: [PATCH] Fix CI --- .github/workflows/pytest.yml | 56 --------------------------------- .github/workflows/tests.yml | 60 ++++++++++++++++++++++++++++++++++++ manifest.toml | 2 +- 3 files changed, 61 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/pytest.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml deleted file mode 100644 index 4cfde62..0000000 --- a/.github/workflows/pytest.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: pytest - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 8 * * *' - -jobs: - test: - runs-on: ubuntu-latest - strategy: - max-parallel: 2 - matrix: - python-version: ["3.10", "3.9", "3.8", "3.7"] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: 'fetch master' - run: | - git fetch origin master - - name: 'Set up Python ${{ matrix.python-version }}' - uses: actions/setup-python@v2 - with: - python-version: '${{ matrix.python-version }}' - - - uses: actions/cache@v2 - with: - path: ~/.cache/ - key: dot-cache-files - - - name: 'Install package' - run: | - pip3 install poetry - make install - - - name: 'List installed packages' - run: | - poetry run pip freeze - - - name: 'Run tests with Python v${{ matrix.python-version }}' - run: | - make pytest - - - name: 'Run Safety check' - run: | - make safety - - - name: 'Upload coverage report' - uses: codecov/codecov-action@v2 - with: - fail_ci_if_error: false - verbose: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8145b29 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,60 @@ +name: tests + +on: + push: + branches: + - master + pull_request: + schedule: + - cron: '0 8 * * *' + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.12", "3.11", "3.10"] + steps: + - name: Checkout + run: | + echo $GITHUB_REF $GITHUB_SHA + git clone https://github.com/$GITHUB_REPOSITORY.git . + git fetch origin $GITHUB_SHA:temporary-ci-branch + git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) + + - name: 'Set up Python ${{ matrix.python-version }}' + uses: actions/setup-python@v4 + # https://github.com/marketplace/actions/setup-python + with: + python-version: '${{ matrix.python-version }}' + cache: 'pip' # caching pip dependencies + cache-dependency-path: '**/requirements.*.txt' + + - name: 'Bootstrap dev venv' + # The first CLI call will create the .venv + run: | + ./dev-cli.py version + + - name: 'dev CLI help' + run: | + ./dev-cli.py --help + + - name: 'Safety' + run: | + ./dev-cli.py safety + + - name: 'Run tests with Python v${{ matrix.python-version }}' + env: + PYTHONUNBUFFERED: 1 + PYTHONWARNINGS: always + run: | + ./dev-cli.py tox + + - name: 'Upload coverage report' + uses: codecov/codecov-action@v3 + # https://github.com/marketplace/actions/codecov + with: + fail_ci_if_error: false + verbose: true + diff --git a/manifest.toml b/manifest.toml index 77039d2..bb09111 100644 --- a/manifest.toml +++ b/manifest.toml @@ -103,7 +103,7 @@ ram.runtime = "50M" # **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, [resources.apt] # https://yunohost.org/en/packaging_apps_resources#apt # This will automatically install/uninstall the following apt packages - packages = "build-essential, libffi-dev, git, libpq-dev, postgresql, postgresql-contrib" + packages = "build-essential, libssl-dev, libnss3-dev, libffi-dev, git, libpq-dev, postgresql, postgresql-contrib" [resources.database] # https://yunohost.org/en/packaging_apps_resources#database