-
Notifications
You must be signed in to change notification settings - Fork 3
65 lines (53 loc) · 2.22 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: build
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Checkout qwc-docker
uses: actions/checkout@master
with:
repository: qwc-services/qwc-docker
path: qwc-docker
- name: Start demo database
run: |
cd qwc-docker
sed -i 's|jasper-reporting-service:8080|localhost:8002|' volumes/config/default/documentConfig.json
sed -i 's|\"document_templates\": \[\]|\"document_templates\": \[\"demo\"\]|g' volumes/config/default/permissions.json
docker run -p 127.0.0.1:8002:8080 -d -v $PWD/volumes/jasper-reports/config:/srv/jasper-reporting-service/config:ro -v $PWD/volumes/jasper-reports/demo:/srv/jasper-reporting-service/demo:ro sourcepole/jasper-reporting-service:v2023.05.12
- name: Setting up python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Run unittests
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
PYTHONPATH=$PWD/src CONFIG_PATH=$PWD/qwc-docker/volumes/config/ python test.py
- name: Validate schema
run: |
python -m pip install check-jsonschema
check-jsonschema --check-metaschema schemas/qwc-search-service.json
build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@master
- name: Get version tag
id: get_tag
run: |
if [ ${{ endsWith(github.ref, '-lts') }} = true ]; then
echo "tag=latest-lts,latest-${GITHUB_REF:11:4}-lts,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
else
echo "tag=latest,${GITHUB_REF:10}" >>$GITHUB_OUTPUT
fi
- name: Build and publish docker image
uses: elgohr/Publish-Docker-Github-Action@v5
if: github.event_name != 'pull_request'
with:
name: sourcepole/${{ github.event.repository.name }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
tags: "${{ steps.get_tag.outputs.tag }}"