-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 2.84 KB
/
it.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
name: Config Service Integration Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
it:
runs-on: ubuntu-22.04
strategy:
matrix:
java: [ '17','21' ]
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
mysql:
image: mysql:8.0.35
ports:
- 3307:3306
env:
MYSQL_ROOT_PASSWORD: Abc12332!
MYSQL_DATABASE: demo_db
env:
SERVER_PORT_NO: 38080
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: |-
mvn -B -P+it package \
-Dskip.container=yes \
-Djava.version=${{ matrix.java }} --file pom.xml
- name: Run AllInOne Application
uses: JarvusInnovations/[email protected]
with:
working-directory: config-demo
wait-for: 2m
tail: true
run: java -jar target/config-demo-fat.jar &
wait-on: http-get://localhost:${{ env.SERVER_PORT_NO }}/actuator/health
- name: Download ijhttp tools
run: |-
curl -f -L -o ijhttp.zip "https://jb.gg/ijhttp/latest"
unzip ijhttp.zip
./ijhttp/ijhttp --version
- name: Execute Integration Tests
run: ./ijhttp/ijhttp config-demo/src/test/http/it.http
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [ "it" ]
runs-on: ubuntu-22.04
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_SECURITY_PWD: ${{ secrets.GPG_SECURITY_PWD }}
steps:
- name: Install gpg secret key
run: |-
# Install gpg secret key
cat <(echo -e "${{ secrets.GPG_SECURITY_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
- name: Set up maven settings
uses: s4u/[email protected]
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
}]
- name: Deploy to OSSRH
run: mvn -P+deploy -Djava.version=17 -DskipTests=true clean deploy