Skip to content

Commit 931eda5

Browse files
author
Anuraag Agrawal
authored
Separate out workflow for main branch push and publish snapshots. (#61)
* Separate out workflow for main branch push and publish snapshots. * Add needs
1 parent 86a0f8b commit 931eda5

File tree

2 files changed

+76
-4
lines changed

2 files changed

+76
-4
lines changed

.github/workflows/main-build.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Main Build"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: build
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Setup Java 11
17+
uses: actions/setup-java@v2
18+
with:
19+
distribution: adopt
20+
java-version: 11
21+
- uses: burrunan/gradle-cache-action@v1
22+
name: Build
23+
with:
24+
arguments: --stacktrace build
25+
remote-build-cache-proxy-enabled: false
26+
- uses: actions/upload-artifact@v2
27+
name: Save unit test results
28+
if: always()
29+
with:
30+
name: test-results
31+
path: jmx-metrics/build/reports/tests/test
32+
integration-test:
33+
name: integration-test
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
with:
38+
fetch-depth: 0
39+
- name: Setup Java 11
40+
uses: actions/setup-java@v2
41+
with:
42+
distribution: adopt
43+
java-version: 11
44+
- uses: burrunan/gradle-cache-action@v1
45+
name: Integration Tests
46+
with:
47+
arguments: --stacktrace integrationTest
48+
remote-build-cache-proxy-enabled: false
49+
- uses: actions/upload-artifact@v2
50+
name: Save integrationTest results
51+
if: always()
52+
with:
53+
name: integration-test-results
54+
path: jmx-metrics/build/reports/tests/test
55+
publish-snapshots:
56+
name: publish-snapshots
57+
runs-on: ubuntu-latest
58+
needs: [build, integration-test]
59+
steps:
60+
- uses: actions/checkout@v2
61+
with:
62+
fetch-depth: 0
63+
- name: Setup Java 11
64+
uses: actions/setup-java@v2
65+
with:
66+
distribution: adopt
67+
java-version: 11
68+
- uses: burrunan/gradle-cache-action@v1
69+
name: Publish
70+
with:
71+
arguments: --stacktrace snapshot
72+
env:
73+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
74+
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
75+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
76+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}

.github/workflows/pr-build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: "PR Build"
22

33
on:
4-
push:
5-
branches:
6-
- main
74
pull_request:
85
branches:
96
- main
@@ -35,7 +32,6 @@ jobs:
3532
integration-test:
3633
name: integration-test
3734
runs-on: ubuntu-latest
38-
needs: build
3935
steps:
4036
- uses: actions/checkout@v2
4137
with:

0 commit comments

Comments
 (0)