Skip to content

#30 Fix uploading path without specified directory #53

#30 Fix uploading path without specified directory

#30 Fix uploading path without specified directory #53

name: Build Native Images
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build native-image on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
include:
- os: windows-latest
binary: bfsc.exe
- os: ubuntu-latest
binary: bfsc
concurrency:
group: ${{ github.workflow }}-${{ matrix.os }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.1'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run tests for native image builds
run: |
mvn --batch-mode clean package "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" -DtrimStackTrace=false -DskipTests "-Dmaven.test.skip=true" "-Dproject-keeper.skip=true" "-Dossindex.skip=true" "-Dmaven.javadoc.skip=true" "-Djacoco.skip=true" "-Dreproducible.skip=true"
native-image -jar target/*.jar target/bfsc
mvn test -D"native.binary=target/${{ matrix.binary }}" -D"org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" -DtrimStackTrace=false -Dtest=NativeImageTest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }} # name of zip file
path: target/${{ matrix.binary }}
if-no-files-found: error