-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (63 loc) · 2.12 KB
/
test.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: Test
on:
workflow_call:
inputs:
version:
required: true
type: string
jobs:
smoke:
runs-on: ubuntu-latest
steps:
- name: Lowercase Repository
run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
env:
REPOSITORY: '${{ github.repository }}'
- name: Download docker compose config
run: wget https://raw.githubusercontent.com/${{ github.repository_owner }}/docker/main/docker-compose.frontend.yml
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "ghcr.io/${{ env.REPOSITORY_LC }}:latest"
replace: "ghcr.io/${{ env.REPOSITORY_LC }}:${{ inputs.version }}"
regex: false
- name: Inject google-credentials.json
run: echo "$GOOGLE_CREDENTIALS" >> google-credentials.json
env:
GOOGLE_CREDENTIALS: ${{secrets.FCM_CREDENTIALS}}
- name: Docker Compose version
run: docker compose version
- name: Start containers
run: docker compose -f "docker-compose.frontend.yml" up -d --wait
- name: Test container
run:
docker run --network container:backend-fireapp-1 appropriate/curl -s --retry 10 --retry-connrefused http://localhost:5000/
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Inject google-credentials.json
run: echo "$GOOGLE_CREDENTIALS" >> google-credentials.json
env:
GOOGLE_CREDENTIALS: ${{secrets.FCM_CREDENTIALS}}
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install snapd
run: |
sudo apt update
sudo apt install snapd
- name: Install MiniZinc
run: |
sudo snap install minizinc --classic
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install minizinc
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest