-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from fjuma/SSLNTV-32
[SSLNTV-32] Add a new GitHub workflow to trigger native builds for pull requests and tags for Windows
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Build Natives | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
working-directory: main | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
include: | ||
- os: windows-latest | ||
vcvars: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: main | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Checkout wildfly-openssl for test purposes | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: wildfly-security/wildfly-openssl | ||
path: wildfly-openssl | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Maven Version Info | ||
run: mvn -version | ||
- if: matrix.os != 'windows-latest' | ||
name: OpenSSL Library Version Info | ||
run: openssl version -v | ||
- if: matrix.os == 'windows-latest' | ||
name: Install Full OpenSSL Library | ||
run: | | ||
vcpkg install openssl:x64-windows | ||
- if: matrix.os != 'windows-latest' | ||
name: Build with Maven | ||
run: | | ||
openssl version -v | ||
mvn -B package --file pom.xml | ||
- if: matrix.os == 'windows-latest' | ||
name: Build with Microsoft Visual Studio native tools command prompt and Maven | ||
env: | ||
VCVARS: ${{ matrix.vcvars }} | ||
shell: cmd | ||
run: | | ||
call "%VCVARS%" x64 | ||
set PATH=C:\vcpkg\installed\x64-windows\tools\openssl;%PATH% | ||
openssl version -v | ||
mvn -B install --file pom.xml | ||
- if: matrix.os == 'windows-latest' | ||
name: Run tests with the built Windows native | ||
env: | ||
VCVARS: ${{ matrix.vcvars }} | ||
working-directory: wildfly-openssl | ||
shell: cmd | ||
run: | | ||
call "%VCVARS%" x64 | ||
set PATH=C:\vcpkg\installed\x64-windows\tools\openssl;%PATH% | ||
openssl version -v | ||
for /f "tokens=3 delims=<> skip=1" %%v in ('findstr "<version>" ..\main\pom.xml') do set WILDFLY_OPENSSL_NATIVES_VERSION=%%v | ||
echo Running tests with WildFly OpenSSL Natives %WILDFLY_OPENSSL_NATIVES_VERSION% | ||
mvn -B verify --file pom.xml -Dorg.wildfly.openssl.path="C:\vcpkg\installed\x64-windows\tools\openssl" -Dversion.org.wildfly.openssl.natives=%WILDFLY_OPENSSL_NATIVES_VERSION% | ||
- if: ${{ github.event_name == 'push' }} | ||
name: Archive the built native artifacts if this is a tag | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: built-natives | ||
path: | | ||
**/target/**.jar |