Skip to content

Commit a5303ef

Browse files
First untested checkin of composite actions. Lots of fixes upcoming
1 parent 635a22f commit a5303ef

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed

cdflow2-deploy/action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "deploy cdflow2 release"
2+
description: "deploy cdflow2 release"
3+
4+
inputs:
5+
release_name:
6+
description: "Name of release, default should be adequate"
7+
required: true
8+
default: "main-${{ github.run_number }}-${{ github.sha }}"
9+
capability:
10+
description: "key to find AWS authentication info in github actions secrets context. E.g. 'CAPINTERFACE', 'CAPAUTOMATION', etc."
11+
required: true
12+
environment:
13+
description: "live or aslive"
14+
required: true
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
if: ${{ github.ref == 'refs/heads/main' }}
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
23+
- name: Notify Teams
24+
uses: toko-bifrost/[email protected]
25+
with:
26+
github-token: ${{ github.token }}
27+
webhook-uri: ${{ secrets.MSTEAMS_WEBHOOK }}
28+
card-layout-exit: compact
29+
show-on-start: false
30+
31+
- name: Get latest cdflow2
32+
run: curl -Lo infra/cdflow2 https://github.com/mergermarket/cdflow2/releases/latest/download/cdflow2-linux-amd64 && chmod +x infra/cdflow2
33+
34+
- name: Deploy to ${{ inputs.environment }}
35+
env:
36+
AWS_ACCESS_KEY_ID: ${{ format('secrets,{0}_AWS_ACCESS_KEY_ID', ${{ inputs.capability }}
37+
AWS_SECRET_ACCESS_KEY: ${{ format('secrets,{0}_AWS_SECRET_ACCESS_KEY', ${{ inputs.capability }}
38+
run: infra/cdflow2 deploy aslive ${{ inputs.release_name }}

cdflow2-release/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "prepare cdflow2 release"
2+
description: "prepare cdflow2 release"
3+
4+
inputs:
5+
release_name:
6+
description: "Name of release, default should be adequate"
7+
required: true
8+
default: "main-${{ github.run_number }}-${{ github.sha }}"
9+
capability:
10+
description: "key to find AWS authentication info in github actions secrets context. E.g. 'CAPINTERFACE', 'CAPAUTOMATION', etc."
11+
required: true
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Prepare multilayered jar
17+
run: mvn -B -V clean package --file pom.xml -s $GITHUB_WORKSPACE/settings.xml -Dmaven.javadoc.skip=true -DskipTests -Dmaven.test.skip=true -Dmaven.deploy.skip=true -Ddockerfile.skip -DdockerCompose.skip
18+
env:
19+
MAVEN_USERNAME: ${{ secrets.IONA_GITHUB_PACKAGE_USER }}
20+
MAVEN_PASSWORD: ${{ secrets.IONA_GITHUB_PACKAGE_TOKEN }}
21+
22+
- name: Extract multilayered jar layers
23+
run: |
24+
cp target/spac-search-api*.jar target/application.jar
25+
mkdir target/extracted
26+
java -Djarmode=layertools -jar target/application.jar extract --destination target/extracted
27+
28+
- name: Get latest cdflow2
29+
run: curl -Lo infra/cdflow2 https://github.com/mergermarket/cdflow2/releases/latest/download/cdflow2-linux-amd64 && chmod +x infra/cdflow2
30+
31+
- name: Prepare release
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}
34+
AWS_ACCESS_KEY_ID: ${{ format('secrets,{0}_AWS_ACCESS_KEY_ID', ${{ inputs.capability }}
35+
AWS_SECRET_ACCESS_KEY: ${{ format('secrets,{0}_AWS_SECRET_ACCESS_KEY', ${{ inputs.capability }}
36+
run: infra/cdflow2 release ${{ inputs.release_name }}

code-analysis/action.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Static Code Analysis'
2+
description: 'License checks, CodeQL, spotbugs, etc'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Initialize CodeQL
8+
uses: github/codeql-action/init@v1
9+
with:
10+
languages: java
11+
12+
- name: Check third-party licenses
13+
run: |
14+
mvn -B -V -s $GITHUB_WORKSPACE/settings.xml -Dmaven.test.skip=true -DskipTests=true -Djacoco.skip=true \
15+
org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party -Dlicense.outputDirectory=src/main/resources/META-INF/license \
16+
-Dlicense.useMissingFile -Dlicense.useRepositoryMissingFiles=false -Dlicense.excludedGroups=com\\.ionanalytics.* \
17+
-Dlicense.licenseMergesUrl=file:src/main/license/license-merges.txt \
18+
-Dlicense.missingFileUrl=file:src/main/license/license-missing.txt \
19+
-Dlicense.overrideUrl=file:src/main/license/license-overrides.txt \
20+
-Dlicense.failOnBlacklist=true -Dlicense.failOnMissing=true -Dlicense.excludedScopes=test \
21+
-Dlicense.excludedLicenses=file:src/main/license/license-blacklist.txt \
22+
-Dlicense.includedLicenses=file:src/main/license/license-whitelist.txt
23+
24+
- name: Fetch findsecbugs spotbugs plugin
25+
run: mvn dependency:copy -Dartifact=com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0
26+
27+
- name: Perform Spotbugs Analysis
28+
run: |
29+
mvn -B -V -s $GITHUB_WORKSPACE/settings.xml -Dmaven.test.skip=true -DskipTests=true \
30+
-Dspotbugs.sarifOutput=true -Dspotbugs.sarifFullPath=true -Dspotbugs.threshold=high -Dspotbugs.pluginList=target/dependency/findsecbugs-plugin-1.11.0.jar \
31+
com.github.spotbugs:spotbugs-maven-plugin:4.4.1:spotbugs
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.IONA_GITHUB_PACKAGE_USER }}
34+
MAVEN_PASSWORD: ${{ secrets.IONA_GITHUB_PACKAGE_TOKEN }}
35+
36+
- name: Upload Spotbugs sarif result
37+
uses: github/codeql-action/upload-sarif@v1
38+
with:
39+
sarif_file: target/spotbugsSarif.json
40+

java-build/action.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Java Build"
2+
description: "Build Java application in Github"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Checkout code
8+
uses: actions/checkout@v2
9+
10+
- name: Initialize CodeQL
11+
uses: github/codeql-action/init@v1
12+
with:
13+
languages: java
14+
15+
- name: Set up JDK11
16+
uses: actions/setup-java@v2
17+
with:
18+
distribution: 'temurin'
19+
java-version: '11'
20+
cache: 'maven'
21+
server-id: github
22+
settings-path: ${{ github.workspace }}
23+
24+
- name: Cache Maven packages
25+
uses: actions/cache@v2
26+
with:
27+
path: ~/.m2/repository
28+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
29+
restore-keys: ${{ runner.os }}-m2-
30+
31+
# assumes repository is defined in pom.xml. mvn deploy runs all prerequisite steps including build
32+
- name: Deploy Snapshot
33+
run: mvn -B -V -U deploy -s $GITHUB_WORKSPACE/settings.xml
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.IONA_GITHUB_PACKAGE_TOKEN }}
36+

0 commit comments

Comments
 (0)