-
Notifications
You must be signed in to change notification settings - Fork 69
117 lines (101 loc) · 3.82 KB
/
dev.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Dev
concurrency: build
on:
push:
branches:
- main
- 'release/*'
pull_request:
branches:
- main
- 'release/*'
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- name: Prepare - Checkout
uses: actions/checkout@v4.0.0
- name: Prepare - Inject short Variables
uses: rlespinasse/github-slug-action@v4.3.2
- name: Prepare - Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
- name: Prepare - Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Build - BUILD
uses: docker/build-push-action@v6.2.0
with:
load: true
build-args: "NOTIFO__RUNTIME__VERSION=1.0.0-dev-${{ env.BUILD_NUMBER }}"
cache-from: type=gha
cache-to: type=gha,mode=max
tags: notifo-local
- name: Test - Inject Google Credentials
if: github.event_name != 'pull_request'
run: mkdir secrets && echo "$GOOGLE__KEYFILE" >| secrets/keyfile.json
working-directory: tools/TestSuite
env:
GOOGLE__KEYFILE: ${{ secrets.GOOGLE__KEYFILE }}
- name: Test - Start Compose
run: docker-compose up -d
working-directory: tools/TestSuite
- name: Test - RUN
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
MAILCATCHER__HOST__SMTP=mailcatcher
MESSAGEBIRD__ACCESSKEY=${{ secrets.MESSAGEBIRD__ACCESSKEY }}
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8080
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test1
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
- name: Test - RUN on GooglePubSub
if: github.event_name != 'pull_request'
uses: kohlerdominik/docker-run-action@v2.0.0
with:
image: mcr.microsoft.com/dotnet/sdk:8.0
environment: |
MAILCATCHER__HOST__SMTP=mailcatcher
MESSAGEBIRD__ACCESSKEY=${{ secrets.MESSAGEBIRD__ACCESSKEY }}
CONFIG__WAIT=60
CONFIG__SERVER__URL=http://localhost:8081
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
default_network: host
options: --name test2
volumes: ${{ github.workspace }}:/src
run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
- name: Test - Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2.2.1
with:
images: 'notifo-local,squidex/resizer'
tail: '100'
- name: Test - Cleanup
if: always()
run: docker-compose down
working-directory: tools/TestSuite
- name: Publish - Calculate Version
if: github.event_name != 'pull_request'
env:
BUILD_NUMBER: ${{ github.run_number }}
run: |
echo "BUILD_NUMBER=$(($BUILD_NUMBER + 1000))" >> $GITHUB_ENV
- name: Publish - Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish - Rename Tags
if: github.event_name != 'pull_request'
run: |
docker tag notifo-local squidex/notifo-dev
docker tag notifo-local squidex/notifo-dev:${{ env.BUILD_NUMBER }}
- name: Publish - Push Tags
if: github.event_name != 'pull_request'
run: |
docker push squidex/notifo-dev
docker push squidex/notifo-dev:${{ env.BUILD_NUMBER }}