Rest-api tests - ghcr.io/verapdf/rest:latest #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rest-api tests - ghcr.io/verapdf/rest:latest | |
on: | |
schedule: | |
- cron: "05 09 * * 1" | |
workflow_dispatch: | |
jobs: | |
test: | |
if: github.repository == 'veraPDF/veraPDF-rest' | |
name: Rest-api tests running in Docker container | |
runs-on: ubuntu-latest | |
container: ubuntu | |
services: | |
verarest: | |
image: ghcr.io/verapdf/rest:latest | |
ports: | |
- 8080:8080 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Preparing Linux packages(Python and more ...) | |
if: runner.os == 'Linux' | |
run: | | |
echo pwd: $PWD | |
echo dir: $(ls ./) | |
apt-get update -y | |
apt-get install python3 -y | |
apt-get install python3-pip -y | |
echo install python3-venv -y | |
apt-get install python3-venv -y | |
echo python3 -m venv .venv | |
python3 -m venv .venv | |
echo . .venv/bin/activate | |
. .venv/bin/activate | |
echo which python | |
which python | |
echo python3 -m pip install -r requirements.txt | |
python3 -m pip install -r requirements.txt | |
echo $(pip list) | |
echo pwd: $PWD | |
mkdir ./results | |
echo $(pip list) | |
echo dir: $(ls ./) | |
echo $(which python) | |
echo $(pytest --version) | |
pytest --base_url=http://verarest:8080 --html=./results/report.html ./tests/ | |
echo $(ls ./results/) | |
- name: Generating report | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: Results | |
path: "./results" | |
- name: Notify slack tests succeeded | |
if: success() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel_id: C03E3JJGLQL | |
status: SUCCESS | |
color: good | |
- name: Notify slack tests failed | |
if: failure() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel_id: C03E3JJGLQL | |
status: FAILED | |
color: danger |