-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (61 loc) · 1.86 KB
/
build.yml
File metadata and controls
69 lines (61 loc) · 1.86 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: mailosaur-python
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build (${{ matrix.environment }})
runs-on: ${{ vars.LINUX }}
timeout-minutes: 10
strategy:
fail-fast: false
max-parallel: 1
matrix:
environment: [live, next]
env:
MAILOSAUR_BASE_URL: ${{ matrix.environment == 'live' && 'https://mailosaur.com/' || 'https://next.mailosaur.com/' }}
MAILOSAUR_SMTP_HOST: ${{ matrix.environment == 'live' && 'mailosaur.net' || '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 }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ vars.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
notify:
name: Notify
if: ${{ always() }}
needs: build
runs-on: ${{ vars.LINUX }}
steps:
- name: Checkout custom actions
uses: actions/checkout@v4
with:
repository: mailosaur/actions
token: ${{ secrets.CUSTOM_ACTIONS_TOKEN }}
path: .github/actions
- name: Send notifications
uses: ./.github/actions/notify
with:
webhook-url: ${{ secrets.NOTIFICATION_URL }}
needs: ${{ toJson(needs) }}
data: '{"matrixBuildResult": "${{ needs.build.result }}"}'