Skip to content

Execute tests on georchestra/docker:master #54

Execute tests on georchestra/docker:master

Execute tests on georchestra/docker:master #54

name: Execute tests on georchestra/docker:master
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: "0 4 * * *"
permissions: write-all
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: tests
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 georchestra-127-0-0-1.nip.io" | sudo tee -a /etc/hosts
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: Ensure browsers are installed
run: python -m playwright install --with-deps
- name: Checkout geOrchestra/docker
uses: actions/checkout@v4
with:
repository: georchestra/docker
submodules: 'recursive'
ref: 'data-api-24'
path: 'docker'
- name: Launch docker-compose
run: |
cd docker
docker compose up -d --wait --quiet-pull
cd ..
echo "Trigger GN wro4j..."
curl -k https://georchestra-127-0-0-1.nip.io/geonetwork/srv/eng/catalog.search
- name: Caddy trust
run: |
wget "https://caddyserver.com/api/download?os=linux&arch=amd64" -O caddy
chmod +x caddy
./caddy trust
- name: Run your tests
run: |
cd ./tests
pwd
pytest tests --tracing=retain-on-failure --alluredir=allure-results --base-url=https://georchestra-127-0-0-1.nip.io --reruns=1
cd ..
- name: Load test report history
uses: actions/checkout@v3
continue-on-error: true
if: always()
with:
ref: gh-pages
path: gh-pages
- name: Build test report
uses: simple-elf/[email protected]
if: always()
with:
allure_results: tests/allure-results
keep_reports: 5
- name: Publish test report
uses: peaceiris/actions-gh-pages@v3
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: test-results/