Skip to content

Commit

Permalink
gha tests with pyenv
Browse files Browse the repository at this point in the history
  • Loading branch information
bleybaert committed May 28, 2024
1 parent ca4189b commit f107881
Showing 1 changed file with 127 additions and 16 deletions.
143 changes: 127 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,129 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
pull_request:

jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
PLONE_VERSION: [4.3]
services:
libreoffice:
image: imiobe/libreoffice:7.3
ports:
- 2002:2002
volumes:
- /tmp:/tmp
- /var/tmp:/var/tmp
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: Checkout
uses: actions/checkout@v2
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v14"
with:
default: 2.7.18
versions: 3.8.16
command: pyenv -v
- name: Setup Env
run: |
mkdir -p -m 777 /tmp/appy/
sudo add-apt-repository ppa:libreoffice/ppa -y
sudo apt update -qq -y
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
sudo apt-get autoremove -qq -y
sudo apt-get autoclean -qq -y
mkdir -p buildout-cache/{eggs,downloads}
pip install -r requirements.txt
- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.PLONE_VERSION }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.PLONE_VERSION }}
- name: buildout
run: |
sed -ie "s#plone-5#plone-${{matrix.PLONE_VERSION}}#" test-ci.cfg
pip install -r requirements.txt coverage==5.3.1
buildout -c test-ci.cfg annotate
buildout -c test-ci.cfg
bin/translation-manage -c
- name: code-analysis
run: |
bin/code-analysis
- name: test
run: |
docker ps -a
bin/test --test=\!"robot"
coverage:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
PLONE_VERSION: [4.3]
services:
libreoffice:
image: imiobe/libreoffice:7.3
ports:
- 2002:2002
volumes:
- /tmp:/tmp
- /var/tmp:/var/tmp
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v14"
with:
default: 2.7.18
versions: 3.8.16
command: pyenv -v
- name: Setup Env
run: |
mkdir -p -m 777 /tmp/appy/
sudo add-apt-repository ppa:libreoffice/ppa -y
sudo apt update -qq -y
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
sudo apt-get autoremove -qq -y
sudo apt-get autoclean -qq -y
mkdir -p buildout-cache/{eggs,downloads}
pip install -r requirements.txt
- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ matrix.PLONE_VERSION }}
restore-keys: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ matrix.PLONE_VERSION }}
- name: buildout
run: |
sed -ie "s#plone-5#plone-${{matrix.PLONE_VERSION}}#" test-ci.cfg
pip install -r requirements.txt coverage==5.3.1
buildout -c test-ci.cfg annotate
buildout -c test-ci.cfg
bin/translation-manage -c
- name: test coverage
run: |
bin/coverage run bin/test --test=\!"robot"
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Coveralls
run: |
pip3 install -U pip setuptools --no-cache-dir
pip3 install -U "coveralls>=3.0.0" coverage==5.3.1 --no-cache-dir
- name: Publish to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github

0 comments on commit f107881

Please sign in to comment.