Skip to content

Commit 90e024d

Browse files
authored
Remote repository scanning improvements (#60)
* Remote repository scanning improvements progress * remote-repository: Remote repository file reading improvements for Bitbucket * remote-repository: Fix maven version * remote-repository: Update groovy to 3.0.9 for JDK 17 support * remote-repository: Fix maven version in test * remote-repository: Fix more tests for JDK 17 * remote-repository: Fix Dockerfile ci images references * remote-repository: Fix java8 graalvm version * remote-repository: Vulnerability fixes, Fixes #38, Fixes #59, update ci with docker login and graalvm github actions * remote-repository: Login to GHCR with correct creds * remote-repository: Update static native imate to be -H:+StaticExecutableWithDynamicLibC * remote-repository: Update busybox * remote-repository: Static native image builds on musl, scratch Docker image, disabling Bintray publish * remote-repository: Update github workflows * remote-repository: Fix native image builder and push to ghcr * remote-repository: Fix docker image builder for native image musl, and use github actions for docker layer caching * remote-repository: Push docker builders * remote-repository: Push docker builders * remote-repository: 0.7.0 * remote-repository: Skip native image build for java 8 * remote-repository: Skip native image build for java 8 * remote-repository: Fix java8 build and workflow dependencies * remote-repository: Fix needs syntax * remote-repository: 1.8 reference to identigy java 8 in mvn profile * remote-repository: Skip failsafe integration tests for java8 * remote-repository: Only build dist when not java 8 * remote-repository: Fix dist pom * remote-repository: Don't cache docker builders * remote-repository: Only build dist for java 11, use 20.3.0 for windows native image * Revert to Test Report * remote-repository: Remove git-commitid-plugin, fixes #68 * remote-repository: Fix git scripts format * remote-repository: Archive completion script without 'bash' * remote-repository: Update workflow names and archive linux native image * Fix Linux native image archive path
1 parent 7e5cd75 commit 90e024d

File tree

68 files changed

+1176
-1439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1176
-1439
lines changed

.github/workflows/build-and-push-docker-builders.yml

+74-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,79 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- name: Git Checkout
14+
uses: actions/checkout@v2
1415
with:
1516
ref: ${{ github.event.inputs.ref }}
16-
- name: Build and Push Docker Images to Github Container Registry
17-
shell: bash
18-
run: ./distributions/scripts/build-and-push-docker-builders.sh
19-
env:
20-
DOCKER_USERNAME: ${{ secrets.GIT_USERNAME }}
21-
DOCKER_PASSWORD: ${{ secrets.GIT_PACKAGE_TOKEN }}
17+
- name: Set up Docker Buildx
18+
id: buildx
19+
uses: docker/setup-buildx-action@v1
20+
- name: Login to Github Container Registry
21+
uses: docker/login-action@v1
22+
with:
23+
registry: ghcr.io
24+
username: ${{ secrets.GIT_USERNAME }}
25+
password: ${{ secrets.GIT_PACKAGE_TOKEN }}
26+
- name: Build and Push graalvm-ce-21.3.0-java11
27+
uses: docker/build-push-action@v2
28+
with:
29+
builder: ${{ steps.buildx.outputs.name }}
30+
context: .
31+
file: distributions/docker-builders/Dockerfile-nativeimage
32+
build-args: FROM_VERSION=java11-21.3.0
33+
tags: ghcr.io/optum/ci/nativeimage:graalvm-ce-21.3.0-java11
34+
push: true
35+
- name: Build and Push graalvm-ce-21.3.0-java17
36+
uses: docker/build-push-action@v2
37+
with:
38+
builder: ${{ steps.buildx.outputs.name }}
39+
context: .
40+
file: distributions/docker-builders/Dockerfile-nativeimage
41+
build-args: FROM_VERSION=java17-21.3.0
42+
tags: ghcr.io/optum/ci/nativeimage:graalvm-ce-21.3.0-java17
43+
push: true
44+
- name: Build and Push rpmbuild centos7
45+
uses: docker/build-push-action@v2
46+
with:
47+
builder: ${{ steps.buildx.outputs.name }}
48+
context: .
49+
file: distributions/docker-builders/Dockerfile-rpmbuild
50+
build-args: FROM=centos:7
51+
tags: ghcr.io/optum/ci/rpmbuild:centos7
52+
push: true
53+
- name: Build and Push rpmbuild centos8
54+
uses: docker/build-push-action@v2
55+
with:
56+
builder: ${{ steps.buildx.outputs.name }}
57+
context: .
58+
file: distributions/docker-builders/Dockerfile-rpmbuild
59+
build-args: FROM=centos:8
60+
tags: ghcr.io/optum/ci/rpmbuild:centos8
61+
push: true
62+
- name: Build and Push rpmbuild fedora33
63+
uses: docker/build-push-action@v2
64+
with:
65+
builder: ${{ steps.buildx.outputs.name }}
66+
context: .
67+
file: distributions/docker-builders/Dockerfile-rpmbuild
68+
build-args: FROM=fedora:33
69+
tags: ghcr.io/optum/ci/rpmbuild:fedora33
70+
push: true
71+
- name: Build and Push rpmbuild fedora34
72+
uses: docker/build-push-action@v2
73+
with:
74+
builder: ${{ steps.buildx.outputs.name }}
75+
context: .
76+
file: distributions/docker-builders/Dockerfile-rpmbuild
77+
build-args: FROM=fedora:34
78+
tags: ghcr.io/optum/ci/rpmbuild:fedora34
79+
push: true
80+
- name: Build and Push rpmbuild fedora35
81+
uses: docker/build-push-action@v2
82+
with:
83+
builder: ${{ steps.buildx.outputs.name }}
84+
context: .
85+
file: distributions/docker-builders/Dockerfile-rpmbuild
86+
build-args: FROM=fedora:35
87+
tags: ghcr.io/optum/ci/rpmbuild:fedora35
88+
push: true

.github/workflows/maven-ci.yml

+49-42
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ jobs:
4141
matrix:
4242
java: ['8', '11', '17']
4343
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/cache@v1
44+
- name: Checkout Source Code
45+
uses: actions/checkout@v2
46+
- name: Setup Maven Cache
47+
uses: actions/cache@v1
4648
with:
4749
path: ~/.m2
4850
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4951
restore-keys: ${{ runner.os }}-m2
50-
- uses: actions/cache@v1
52+
- name: Setup Sonar Cache
53+
uses: actions/cache@v1
5154
with:
5255
path: ~/.sonar/cache
5356
key: ${{ runner.os }}-sonar
@@ -78,27 +81,33 @@ jobs:
7881
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
7982
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
8083
SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
84+
- name: Archive Linux Native Image
85+
if: success() && (matrix.java == '11')
86+
uses: actions/upload-artifact@v2
87+
with:
88+
name: linux-native-image
89+
path: distributions/linux/target/sourcehawk
8190
- name: Archive Native Image JAR
82-
if: success()
91+
if: success() && (matrix.java == '11')
8392
uses: actions/upload-artifact@v2
8493
with:
85-
name: native-image-${{ matrix.java }}
94+
name: native-image-jar
8695
path: cli/target/*-native-image.jar
87-
- name: Archive Bash Completion Script
88-
if: success()
96+
- name: Archive Completion Script
97+
if: success() && (matrix.java == '11')
8998
uses: actions/upload-artifact@v2
9099
with:
91-
name: bash-completion-script-${{ matrix.java }}
92-
path: cli/target/sourcehawk-bash-completion.sh
100+
name: completion-script
101+
path: cli/target/sourcehawk-completion.sh
93102
- name: Archive Manpages
94-
if: success()
103+
if: success() && (matrix.java == '11')
95104
uses: actions/upload-artifact@v2
96105
with:
97-
name: manpages-${{ matrix.java }}
106+
name: manpages
98107
path: gh-pages/manpages/sourcehawk*.1
99108
- name: Aggregate Coverage Reports
100109
id: aggregate_coverage_reports
101-
if: success()
110+
if: success() && (matrix.java == '11')
102111
run: echo ::set-output name=JACOCO_XML_REPORT_PATHS::$(find . -name "jacoco.xml" -printf '%P\n' | tr '\r\n' ',')
103112
- name: Analyze with SonarCloud
104113
if: success() && (github.event_name == 'push' && matrix.java == '11')
@@ -118,39 +127,39 @@ jobs:
118127
runs-on: macos-latest
119128
needs: build
120129
steps:
121-
- uses: actions/download-artifact@v2
130+
- name: Download Native Image JAR
131+
uses: actions/download-artifact@v2
122132
with:
123-
name: native-image-8
133+
name: native-image-jar
124134
path: build
125-
- uses: actions/download-artifact@v2
135+
- name: Download Completion Script
136+
uses: actions/download-artifact@v2
126137
with:
127-
name: bash-completion-script-8
138+
name: completion-script
128139
path: build
129-
- uses: actions/download-artifact@v2
140+
- name: Download Manpages
141+
uses: actions/download-artifact@v2
130142
with:
131-
name: manpages-8
143+
name: manpages
132144
path: build
133145
- name: Rename Native Image JAR
134146
working-directory: build
135147
run: mv *.jar native-image.jar
136-
- name: Setup Java
137-
uses: actions/setup-java@v1
138-
with:
139-
java-version: 8
140148
- name: Setup GraalVM
141-
uses: DeLaGuardo/setup-graalvm@master
149+
uses: graalvm/setup-graalvm@v1
142150
with:
143-
graalvm-version: 21.2.0.java8
144-
- name: Setup GraalVM Native Image Tool
145-
run: gu install native-image
151+
version: '21.3.0'
152+
java-version: '11'
153+
components: 'native-image'
154+
github-token: ${{ secrets.GITHUB_TOKEN }}
146155
- name: Build Mac Native Image
147156
if: success()
148157
working-directory: build
149158
run: native-image -cp native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime --no-fallback
150159
- name: Create Homebrew Tap Formula Archive
151160
if: success()
152161
working-directory: build
153-
run: gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-bash-completion.sh sourcehawk*.1.gz
162+
run: gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-completion.sh sourcehawk*.1.gz
154163
- name: Archive Mac Native Image
155164
if: success()
156165
continue-on-error: true
@@ -172,28 +181,26 @@ jobs:
172181
build-windows-native-image:
173182
runs-on: windows-latest
174183
needs: build
184+
continue-on-error: true
175185
steps:
176-
- uses: actions/download-artifact@v2
186+
- name: Download Native Image JAR
187+
uses: actions/download-artifact@v2
177188
with:
178-
name: native-image-11
189+
name: native-image-jar
179190
path: build
180191
- name: Rename Native Image JAR
181192
working-directory: build
182193
run: ren *.jar native-image.jar
183-
- name: Setup GraalVM Native Image and Visual C Build Tools
184-
run: |
185-
Invoke-RestMethod -Uri https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.3.0/graalvm-ce-java11-windows-amd64-21.3.0.zip -OutFile 'graal.zip'
186-
Expand-Archive -path 'graal.zip' -destinationpath '.'
187-
graalvm-ce-java11-21.3.0\bin\gu.cmd install native-image
188-
choco install visualstudio2017-workload-vctools
194+
- name: Setup GraalVM
195+
uses: graalvm/setup-graalvm@v1
196+
with:
197+
version: '20.3.0'
198+
java-version: '11'
199+
components: 'native-image'
200+
github-token: ${{ secrets.GITHUB_TOKEN }}
189201
- name: Build Windows Native Image
190202
if: success()
191-
shell: cmd
192-
run: |
193-
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
194-
graalvm-ce-java11-21.3.0\bin\native-image -cp .\build\native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime
195-
env:
196-
JAVA_HOME: ./graalvm-ce-java11-21.3.0
203+
run: native-image.cmd -cp .\build\native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime
197204
- name: Archive Windows Native Image
198205
if: success()
199206
continue-on-error: true
@@ -204,4 +211,4 @@ jobs:
204211
- name: Smoke Test
205212
if: success()
206213
shell: cmd
207-
run: sourcehawk.exe help
214+
run: sourcehawk.exe help

0 commit comments

Comments
 (0)