-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (80 loc) · 2.61 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: pr-builder
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
inputs:
version:
description: "Enter PR link (ex: https://github.com/wso2-extensions/identity-inbound-auth-oauth/pull/1481/)"
default:
required: true
repo:
description: "Enter repo name (ex: identity-inbound-auth-oauth)"
default:
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Print Input
run: echo Running the PR builder for PR - ${{ github.event.inputs.version }}
- name: Build init
run: |
wget -c https://raw.githubusercontent.com/wso2/product-is/master/pom.xml -O cache-key-file.xml
- name: Cache maven packages
id: cache-maven-m2
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-pr-builder-${{ hashFiles('cache-key-file.xml') }}
restore-keys: |
${{ runner.os }}-pr-builder-
${{ runner.os }}-pr-builder
- name: Run PR builder
env:
PR_LINK: ${{github.event.inputs.version}}
run: |
wget https://raw.githubusercontent.com/janakamarasena/is-pr-builder-workflow/main/builder.sh
bash builder.sh
- name: Archive PR diff file
if: always()
uses: actions/upload-artifact@v2
with:
name: repo-pr-diff
path: |
${{github.event.inputs.repo}}/diff.diff
if-no-files-found: warn
- name: Archive repo mvn build log
if: always()
uses: actions/upload-artifact@v2
with:
name: repo-mvn-build-log
path: |
${{github.event.inputs.repo}}/mvn-build.log
if-no-files-found: warn
- name: Archive repo surefire reports
if: always()
uses: actions/upload-artifact@v2
with:
name: repo-surefire-report
path: |
${{github.event.inputs.repo}}/**/surefire-reports
if-no-files-found: warn
- name: Archive product-is mvn build log
if: always()
uses: actions/upload-artifact@v2
with:
name: product-is-mvn-build-log
path: |
product-is/mvn-build.log
if-no-files-found: warn
- name: Archive product-is surefire reports
if: always()
uses: actions/upload-artifact@v2
with:
name: product-is-surefire-report
path: |
product-is/**/surefire-reports
if-no-files-found: warn