-
Notifications
You must be signed in to change notification settings - Fork 170
111 lines (91 loc) · 3.11 KB
/
Build.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
name: Build
on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
push:
branches:
- master
env:
ENVIRONMENT: TESTING
JVM_OPTS: -Xmx1024M
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=3 -Xmx4096m -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
TERM: dumb
jobs:
js:
name: Test JS
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV
- name: Test
run: npm install -g @misk/cli && miskweb ci-build -e
jvm:
name: Test JVM
runs-on: [ubuntu-latest]
services:
mysql:
image: mysql:5.7
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
strategy:
matrix:
cmd:
- gradle testShardHibernate -i --scan --no-parallel
- gradle testShardRedis -i --scan --no-parallel
- gradle testShardNonHibernate -i --scan --parallel
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV
- name: Test
run: ${{ matrix.cmd }}
- name: Publish Test Report
if: ${{ always() }}
uses: mikepenz/action-junit-report@v3
with:
check_name: Test Report - ${{ matrix.cmd }}
report_paths: '**/build/test-results/test/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
publish:
name: Publish
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'cashapp/misk' }}
needs: [js, jvm]
runs-on: [ubuntu-latest]
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV
- name: Assign a version
id: assign_version
run: |
# Set a version name like "2023.05.26.091805-c1fcb3a".
# Note the use of %ct which gets the timestamp in UTC, in seconds since UNIX epoch to
# avoid time zone differences leading to non-linear versioning.
VERSION="$(TZ=UTC0 git show --quiet --date='format-local:%Y.%m.%d.%H%M%S' --format='%cd')-$(git rev-parse --short=7 HEAD)"
echo "VERSION_NAME=$VERSION" >> gradle.properties
cat gradle.properties
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Build Misk Web
run: |
npm install -g @misk/cli
miskweb ci-build -e
- name: Publish the artifacts
run: |
gradle clean publish --stacktrace
- name: Tag Misk repo
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.assign_version.outputs.version }}