Skip to content

Commit

Permalink
Remote repository scanning improvements (#60)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
brianwyka authored Jan 24, 2022
1 parent 7e5cd75 commit 90e024d
Show file tree
Hide file tree
Showing 68 changed files with 1,176 additions and 1,439 deletions.
81 changes: 74 additions & 7 deletions .github/workflows/build-and-push-docker-builders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,79 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Git Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref }}
- name: Build and Push Docker Images to Github Container Registry
shell: bash
run: ./distributions/scripts/build-and-push-docker-builders.sh
env:
DOCKER_USERNAME: ${{ secrets.GIT_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.GIT_PACKAGE_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GIT_USERNAME }}
password: ${{ secrets.GIT_PACKAGE_TOKEN }}
- name: Build and Push graalvm-ce-21.3.0-java11
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-nativeimage
build-args: FROM_VERSION=java11-21.3.0
tags: ghcr.io/optum/ci/nativeimage:graalvm-ce-21.3.0-java11
push: true
- name: Build and Push graalvm-ce-21.3.0-java17
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-nativeimage
build-args: FROM_VERSION=java17-21.3.0
tags: ghcr.io/optum/ci/nativeimage:graalvm-ce-21.3.0-java17
push: true
- name: Build and Push rpmbuild centos7
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-rpmbuild
build-args: FROM=centos:7
tags: ghcr.io/optum/ci/rpmbuild:centos7
push: true
- name: Build and Push rpmbuild centos8
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-rpmbuild
build-args: FROM=centos:8
tags: ghcr.io/optum/ci/rpmbuild:centos8
push: true
- name: Build and Push rpmbuild fedora33
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-rpmbuild
build-args: FROM=fedora:33
tags: ghcr.io/optum/ci/rpmbuild:fedora33
push: true
- name: Build and Push rpmbuild fedora34
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-rpmbuild
build-args: FROM=fedora:34
tags: ghcr.io/optum/ci/rpmbuild:fedora34
push: true
- name: Build and Push rpmbuild fedora35
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: distributions/docker-builders/Dockerfile-rpmbuild
build-args: FROM=fedora:35
tags: ghcr.io/optum/ci/rpmbuild:fedora35
push: true
91 changes: 49 additions & 42 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ jobs:
matrix:
java: ['8', '11', '17']
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Setup Maven Cache
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- uses: actions/cache@v1
- name: Setup Sonar Cache
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand Down Expand Up @@ -78,27 +81,33 @@ jobs:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
- name: Archive Linux Native Image
if: success() && (matrix.java == '11')
uses: actions/upload-artifact@v2
with:
name: linux-native-image
path: distributions/linux/target/sourcehawk
- name: Archive Native Image JAR
if: success()
if: success() && (matrix.java == '11')
uses: actions/upload-artifact@v2
with:
name: native-image-${{ matrix.java }}
name: native-image-jar
path: cli/target/*-native-image.jar
- name: Archive Bash Completion Script
if: success()
- name: Archive Completion Script
if: success() && (matrix.java == '11')
uses: actions/upload-artifact@v2
with:
name: bash-completion-script-${{ matrix.java }}
path: cli/target/sourcehawk-bash-completion.sh
name: completion-script
path: cli/target/sourcehawk-completion.sh
- name: Archive Manpages
if: success()
if: success() && (matrix.java == '11')
uses: actions/upload-artifact@v2
with:
name: manpages-${{ matrix.java }}
name: manpages
path: gh-pages/manpages/sourcehawk*.1
- name: Aggregate Coverage Reports
id: aggregate_coverage_reports
if: success()
if: success() && (matrix.java == '11')
run: echo ::set-output name=JACOCO_XML_REPORT_PATHS::$(find . -name "jacoco.xml" -printf '%P\n' | tr '\r\n' ',')
- name: Analyze with SonarCloud
if: success() && (github.event_name == 'push' && matrix.java == '11')
Expand All @@ -118,39 +127,39 @@ jobs:
runs-on: macos-latest
needs: build
steps:
- uses: actions/download-artifact@v2
- name: Download Native Image JAR
uses: actions/download-artifact@v2
with:
name: native-image-8
name: native-image-jar
path: build
- uses: actions/download-artifact@v2
- name: Download Completion Script
uses: actions/download-artifact@v2
with:
name: bash-completion-script-8
name: completion-script
path: build
- uses: actions/download-artifact@v2
- name: Download Manpages
uses: actions/download-artifact@v2
with:
name: manpages-8
name: manpages
path: build
- name: Rename Native Image JAR
working-directory: build
run: mv *.jar native-image.jar
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Setup GraalVM
uses: DeLaGuardo/setup-graalvm@master
uses: graalvm/setup-graalvm@v1
with:
graalvm-version: 21.2.0.java8
- name: Setup GraalVM Native Image Tool
run: gu install native-image
version: '21.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Mac Native Image
if: success()
working-directory: build
run: native-image -cp native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime --no-fallback
- name: Create Homebrew Tap Formula Archive
if: success()
working-directory: build
run: gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-bash-completion.sh sourcehawk*.1.gz
run: gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-completion.sh sourcehawk*.1.gz
- name: Archive Mac Native Image
if: success()
continue-on-error: true
Expand All @@ -172,28 +181,26 @@ jobs:
build-windows-native-image:
runs-on: windows-latest
needs: build
continue-on-error: true
steps:
- uses: actions/download-artifact@v2
- name: Download Native Image JAR
uses: actions/download-artifact@v2
with:
name: native-image-11
name: native-image-jar
path: build
- name: Rename Native Image JAR
working-directory: build
run: ren *.jar native-image.jar
- name: Setup GraalVM Native Image and Visual C Build Tools
run: |
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'
Expand-Archive -path 'graal.zip' -destinationpath '.'
graalvm-ce-java11-21.3.0\bin\gu.cmd install native-image
choco install visualstudio2017-workload-vctools
- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '20.3.0'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Windows Native Image
if: success()
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
graalvm-ce-java11-21.3.0\bin\native-image -cp .\build\native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime
env:
JAVA_HOME: ./graalvm-ce-java11-21.3.0
run: native-image.cmd -cp .\build\native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime
- name: Archive Windows Native Image
if: success()
continue-on-error: true
Expand All @@ -204,4 +211,4 @@ jobs:
- name: Smoke Test
if: success()
shell: cmd
run: sourcehawk.exe help
run: sourcehawk.exe help
Loading

0 comments on commit 90e024d

Please sign in to comment.