Skip to content

Commit 2334d2d

Browse files
committed
.
1 parent 0a65d9b commit 2334d2d

7 files changed

Lines changed: 61 additions & 76 deletions

File tree

.github/workflows/build-java.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ on:
88
types: [opened, synchronize, reopened]
99

1010
jobs:
11-
cache:
11+
gradle-cache:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
- run: cd java
1615
- name: Set up JDK 11
1716
uses: actions/setup-java@v1
1817
with:
@@ -29,10 +28,9 @@ jobs:
2928
- name: Build and analyze
3029
env:
3130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3331
run: ./gradlew build --info
3432
working-directory: "java"
35-
33+
3634
# no-cache:
3735
# runs-on: ubuntu-latest
3836
# steps:

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
1-
# githubaction
1+
# GitHub Action
22

3-
GCP, Docker, Terraform, Python, Sonarqube
43

5-
[gke-workload-identity](https://github.com/DevSecOpsSamples/gke-workload-identity/blob/master/.github/workflows/build.yml)
4+
## Sample Repositories
65

6+
- GCP, Docker, Terraform, Python, pytest, Sonarqube: [gke-workload-identity](https://github.com/DevSecOpsSamples/gke-workload-identity/blob/master/.github/workflows/build.yml)
7+
8+
- Docker, CDK, Sonarqube: [jenkins-fargate-cdk](https://github.com/DevSecOpsSamples/jenkins-fargate-cdk/blob/master/.github/workflows/build.yml)
9+
10+
11+
## Docker
712

813
## Cache
14+
15+
- Cache Gradle dependencies: [java/README.md](java/README.md)
16+
17+
[java/.github/workflows/build-java.yml](java/.github/workflows/build-java.yml)
18+
19+
[java/.github/workflows/build-java-sonarqube.yml](java/.github/workflows/build-java-sonarqube.yml)
20+
21+
## Metric
22+
23+
- [gke-workload-identity](https://github.com/DevSecOpsSamples/gke-workload-identity/blob/master/.github/workflows/build.yml)
24+
25+
## Reference
26+
27+
- [GitHub Actions /Using workflows / Cache dependencies / Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#managing-caches)
28+
29+
- https://github.com/actions/cache
30+
31+
- https://github.com/actions/cache/blob/main/examples.md#java---gradle

build-java.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@ on:
88
types: [opened, synchronize, reopened]
99

1010
jobs:
11-
sonarqube:
11+
gradle-cache:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
with:
16-
fetch-depth: 0
1715
- name: Set up JDK 11
1816
uses: actions/setup-java@v1
1917
with:
2018
java-version: 11
21-
- name: Cache SonarCloud packages
22-
uses: actions/cache@v1
23-
with:
24-
path: ~/.sonar/cache
25-
key: ${{ runner.os }}-sonar
26-
restore-keys: ${{ runner.os }}-sonar
2719
- name: Cache Gradle packages
28-
uses: actions/cache@v1
20+
uses: actions/cache@v3
2921
with:
3022
path: |
3123
~/.gradle/caches
3224
~/.gradle/wrapper
3325
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
3426
restore-keys: ${{ runner.os }}-gradle
3527
- name: Build and analyze
36-
# env:
37-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3928
run: ./gradlew build --info
40-
29+
30+
gradle-no-cache:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Set up JDK 11
35+
uses: actions/setup-java@v1
36+
with:
37+
java-version: 11
38+
- name: Build and analyze
39+
run: ./gradlew build --info

cdk.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- develop
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
build-cdk:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
- name: Build CDK
20+
run: cd cdk && npm install && npm run build
File renamed without changes.

python/build-java copy.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)