1- name : CI Tests
1+ name : Tests
22
33on :
44 push :
5- branches : [ master, release/* ]
65 pull_request :
76 branches : [ master ]
87
8+ env :
9+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
10+ REPOSITORY_URL : docker.pkg.github.com
11+
912jobs :
1013 test :
1114 runs-on : ubuntu-latest
12- env :
13- REPOSITORY_URL : docker.pkg.github.com
14- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
1515
1616 strategy :
1717 matrix :
18- python-version : [3.6, 3.7, 3.8, 3.9 ]
18+ python-version : ['3.10', '3.11', '3.12' ]
1919
2020 steps :
21- - name : Checkout
22- uses : actions/checkout@v2
23- - name : Python ${{ matrix.python-version }}
24- uses : actions/setup-python@v2
21+ - uses : actions/checkout@v4
22+ - name : Set up Python ${{ matrix.python-version }}
23+ uses : actions/setup-python@v5
2524 with :
2625 python-version : ${{ matrix.python-version }}
2726 - name : Install dependencies
@@ -41,30 +40,17 @@ jobs:
4140 run : |
4241 flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4342 flake8 . --count --exit-zero --max-complexity=50 --max-line-length=127 --statistics
44- - name : Type Check
45- id : types
46- run : |
47- python -m mypy alertaclient/
4843 - name : Test with pytest
4944 id : unit-test
50- env :
51- DATABASE_URL : postgres://postgres:postgres@localhost:5432/alerta
5245 run : |
5346 pytest --cov=alertaclient tests/unit
54- - name : Docker Login
55- env :
56- DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
57- DOCKER_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
58- run : |
59- docker login $REPOSITORY_URL --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
6047 - name : Integration Test
6148 id : integration-test
6249 run : |
63- docker-compose -f docker-compose.ci.yaml build sut
64- docker-compose -f docker-compose.ci.yaml up --exit-code-from sut
65- docker-compose -f docker-compose.ci.yaml rm --stop --force
66-
67- - uses : act10ns/slack@v1
50+ docker compose -f docker-compose.ci.yaml build sut
51+ docker compose -f docker-compose.ci.yaml up --exit-code-from sut
52+ docker compose -f docker-compose.ci.yaml rm --stop --force
53+ - uses : act10ns/slack@v2
6854 with :
6955 status : ${{ job.status }}
7056 steps : ${{ toJson(steps) }}
0 commit comments