Debian Codegraph @

.github/workflows/smoke-test.yaml

raw
1 name: Smoke test
2
3 on:
4 push:
5 branches:
6 - master
7 schedule:
8 - cron: '0 23 * * 0' # Run every Sunday at 23:00 PM
9 workflow_dispatch: # Allows manual triggering
10
11 permissions:
12 contents: read
13
14 env:
15 python-version: "3.12"
16
17 concurrency:
18 group: "smoke-test" # Make sure, to not run multiple smoke tests at the same time
19 cancel-in-progress: false
20
21 jobs:
22 smoke_test:
23 runs-on: ubuntu-latest
24 strategy:
25 matrix:
26 country:
27 - ch
28 - de
29 - pl
30 - ma
31 - ie
32 steps:
33 - name: Get User Permission
34 id: checkAccess
35 uses: actions-cool/check-user-permission@v2
36 with:
37 require: read
38 username: ${{ github.triggering_actor }}
39 env:
40 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 - name: Check User Permission
42 if: steps.checkAccess.outputs.require-result == 'false'
43 run: |
44 echo "${{ github.triggering_actor }} does not have permissions on this repo."
45 echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
46 echo "Job originally triggered by ${{ github.actor }}"
47 exit 1
48 - name: Checkout code
49 uses: actions/checkout@v6
50 - name: Set up Python ${{ env.python-version }}
51 uses: actions/setup-python@v6
52 with:
53 python-version: ${{ env.python-version }}
54 - name: Check secret access
55 run: |
56 if [[ "x${{ secrets.PASSWORD }}" != "x" ]]; then
57 echo "Access to secrets"
58 else
59 echo "No access to secrets"
60 exit 1
61 fi
62 - name: Install dependencies
63 run: |
64 python -m pip install --upgrade pip
65 pip install -r requirements.txt
66 pip install -r requirements_test.txt
67 - name: Test with pytest
68 run: pytest smoke_test -v -x
69 env:
70 COUNTRY: ${{ matrix.country }}
71 EMAIL_CH: ${{ vars.EMAIL_CH }}
72 EMAIL_DE: ${{ vars.EMAIL_DE }}
73 EMAIL_PL: ${{ vars.EMAIL_PL }}
74 EMAIL_MA: ${{ vars.EMAIL_MA }}
75 EMAIL_IE: ${{ vars.EMAIL_IE }}
76 PASSWORD: ${{ secrets.PASSWORD }}