-
Notifications
You must be signed in to change notification settings - Fork 7
96 lines (87 loc) · 2.95 KB
/
build.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
concurrency:
group: mailosaur-python
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
max-parallel: 1
matrix:
python-version: ['3.9']
env:
MAILOSAUR_BASE_URL: https://mailosaur.com/
MAILOSAUR_SMTP_HOST: mailosaur.net
MAILOSAUR_SMTP_PORT: 2525
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
MAILOSAUR_SERVER: ${{ secrets.MAILOSAUR_SERVER }}
MAILOSAUR_VERIFIED_DOMAIN: ${{ secrets.MAILOSAUR_VERIFIED_DOMAIN }}
MAILOSAUR_PREVIEWS_SERVER: ${{ secrets.MAILOSAUR_PREVIEWS_SERVER }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest
- name: Notify on Failure
uses: skitionek/notify-microsoft-teams@master
if: ${{ failure() }}
with:
webhook_url: ${{ secrets.TEAMS_BUILDS_WEBHOOK }}
needs: ${{ toJson(needs) }}
job: ${{ toJson(job) }}
overwrite: "{ title: `${workflow} failed for ${repository.name}` }"
build-next:
if: ${{ always() }}
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
max-parallel: 1
matrix:
python-version: ['3.9']
env:
MAILOSAUR_BASE_URL: https://next.mailosaur.com/
MAILOSAUR_SMTP_HOST: mailosaur.email
MAILOSAUR_SMTP_PORT: 2525
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
MAILOSAUR_SERVER: ${{ secrets.MAILOSAUR_SERVER }}
MAILOSAUR_VERIFIED_DOMAIN: ${{ secrets.MAILOSAUR_VERIFIED_DOMAIN }}
MAILOSAUR_PREVIEWS_SERVER: ${{ secrets.MAILOSAUR_PREVIEWS_SERVER }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest
- name: Notify on Failure
uses: skitionek/notify-microsoft-teams@master
if: ${{ failure() }}
with:
webhook_url: ${{ secrets.TEAMS_BUILDS_WEBHOOK }}
needs: ${{ toJson(needs) }}
job: ${{ toJson(job) }}
overwrite: "{ title: `${workflow} failed for ${repository.name}` }"