This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
126 lines (110 loc) · 4.13 KB
/
development.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Development Branch
# Suppress Spinner because it appears as warnings
env:
SUPPRESS_SPINNER: true
# Controls when the action will run. Triggers the workflow on push or pull request
on:
push:
branches:
- 'development'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Required to retrieve git history
# Caching
- name: Cache Gradle deps
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache Rush temp files
uses: actions/cache@v2
with:
path: |
common/temp
key: ${{ runner.os }}-rush-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-rush-
- name: Cache NPM
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
# Setup Environments
- name: Setup Java
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '11' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Setup Node
uses: actions/[email protected]
with:
node-version: '14'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
# Analyze
- name: Analyze sprout-core
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CORE }}
GITHUB_TOKEN: ${{ github.token }}
run: ./gradlew :sprout-core:sonarqube --info
- name: Analyze sprout-spring-boot-starter
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_STARTER }}
GITHUB_TOKEN: ${{ github.token }}
run: ./gradlew :sprout-spring-boot-starter:sonarqube --info
- name: Analyze sprout-server
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_SERVER }}
GITHUB_TOKEN: ${{ github.token }}
run: ./gradlew :sprout-server:sonarqube --info
# Install Node dependencies
- name: Rush Update
run: node common/scripts/install-run-rush.js update
# Build the projects
- name: Rush Client Projects
run: node common/scripts/install-run-rush.js build -T webapp --verbose
env:
CI: false
- name: Build Server Projects
run: ./gradlew build
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties