forked from cloudfoundry/cloud_controller_ng
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (92 loc) · 2.8 KB
/
unit_tests.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
name: Unit Tests
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.run_id }}'
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'decisions/**'
- '.github/workflows/docs_test.yml'
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'decisions/**'
- '.github/workflows/docs_test.yml'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
Rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/composite/setup
- name: Run Rubocop
run: bundle exec rake rubocop
- uses: ravsamhq/[email protected]
if: github.event_name == 'push'
with:
status: ${{ job.status }}
notify_when: 'failure' # default is 'success,failure,warnings'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
Test-Postgres:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: ["postgres:10", "postgres:14"]
services:
postgres:
image: ${{ matrix.image }}
env:
POSTGRES_PASSWORD: rootpassword
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/composite/setup
- name: Run tests
run: DB=postgres POSTGRES_CONNECTION_PREFIX="postgres://postgres:rootpassword@localhost:5432" bundle exec rake spec
- uses: ravsamhq/[email protected]
if: github.event_name == 'push'
with:
status: ${{ job.status }}
notify_when: 'failure' # default is 'success,failure,warnings'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
Test-Mysql:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: ["mysql:5.7", "mysql:8.0"]
services:
mysql:
image: ${{ matrix.image }}
env:
MYSQL_DATABASE: cc_test
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/composite/setup
- name: Run tests
run: DB=mysql MYSQL_CONNECTION_PREFIX="mysql2://root:[email protected]:3306" bundle exec rake spec
- uses: ravsamhq/[email protected]
if: github.event_name == 'push'
with:
status: ${{ job.status }}
notify_when: 'failure' # default is 'success,failure,warnings'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required