-
Notifications
You must be signed in to change notification settings - Fork 149
74 lines (61 loc) · 1.79 KB
/
unitTest.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
name: PR - Docker unit test
on:
pull_request:
branches:
- master
types: [opened, reopened, synchronize, edited]
# Please, always create a pull request instead of push to master.
permissions:
contents: read
pull-requests: write
concurrency:
group: docker-test-${{ github.ref_name }}
cancel-in-progress: true
jobs:
test:
name: Docker tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_DATABASE: pmail
MYSQL_ROOT_PASSWORD: githubTest
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres
env:
POSTGRESQL_PASSWORD: githubTest
container:
image: golang
env:
REPOSITORY: ${{ github.repository }}
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
SOURCE_BRANCH: ${{ github.ref_name }}
COMMIT: ${{ github.workflow_sha }}
EVENT: ${{ github.event_name}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pull Request Labeler
if: ${{ failure() }}
uses: actions-cool/issues-helper@v3
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
labels: 'Auto: Test Failed'
- name: Setup Node.js environment
run: apt update && apt install -y nodejs npm
- name: Install Dependencies
run: npm install --global yarn
- name: FE build
run: make build_fe
- name: Run Test
run: make test
- uses: actions/upload-artifact@v4
with:
name: dbfile
path: server/config/pmail_temp.db
- name: Run Test Mysql
run: make test_mysql