NOPUSH #954
Workflow file for this run
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
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: CI | |
# Run CI when pushing a commit to main or creating a pull request or | |
# adding another commit to a pull request or reopening a pull request. | |
on: | |
push: | |
branches-ignore: [ 'dependabot/**' ] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
# Cancel CI runs in progress when a pull request is updated. | |
concurrency: | |
group: ${{ github.head_ref || ((github.ref_name != 'main' && github.ref_name) || github.run_id) }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
# Build Daffodil and run some checks. | |
check: | |
name: Java ${{ matrix.java_version }}, Scala ${{ matrix.scala_version }}, ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
java_distribution: [ temurin ] | |
java_version: [ 17, 21 ] | |
scala_version: [ 2.12.19 ] | |
os: [ ubuntu-22.04, windows-2022 ] | |
include: | |
# configure shell/cc/ar for all OSes | |
- os: ubuntu-22.04 | |
shell: bash | |
env_cc: clang | |
env_ar: llvm-ar-14 | |
- os: windows-2022 | |
shell: msys2 {0} | |
env_cc: clang | |
env_ar: llvm-ar | |
- lang: en_US | |
- encoding: UTF-8 | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: ${{ matrix.shell }} | |
env: | |
AR: ${{ matrix.env_ar }} | |
CC: ${{ matrix.env_cc }} | |
LANG: ${{ matrix.lang }}.${{ matrix.encoding }} | |
SBT: sbt -J--add-opens=java.base/java.io=ALL-UNNAMED -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m -J-Dfile.encoding=${{ matrix.encoding }} ++${{ matrix.scala_version }} | |
SONARSCAN: ${{ | |
matrix.os == 'ubuntu-22.04' && | |
matrix.java_version == '17' && | |
matrix.scala_version == '2.12.19' && | |
github.event_name == 'push' && | |
github.repository == 'apache/daffodil' && | |
github.ref == 'refs/heads/main' | |
}} | |
steps: | |
############################################################ | |
# Setup | |
############################################################ | |
- name: Install Dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -y libmxml-dev | |
sudo locale-gen $LANG | |
- name: Install Dependencies (Windows) | |
if: runner.os == 'Windows' | |
uses: msys2/setup-msys2@cc11e9188b693c2b100158c3322424c4cc1dadea # v2.22.0 | |
with: | |
install: clang diffutils make pkgconf | |
path-type: inherit | |
- name: Check out mxml source (Windows) | |
if: runner.os == 'Windows' | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: michaelrsweet/mxml | |
ref: v3.3 | |
path: mxml | |
- name: Install mxml library (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
# Our codegen-c tests may break if mxml library is compiled with clang | |
export AR=ar CC=cc | |
cd mxml | |
./configure --prefix=/usr --disable-shared --disable-threads | |
make install | |
# Workaround for sbt hanging problem | |
echo "COURSIER_CACHE=$temp" >> $GITHUB_ENV | |
echo "COURSIER_CONFIG_DIR=$temp" >> $GITHUB_ENV | |
- name: Check out Repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
# Disabling shallow clone is recommended for improving sonarcloud reporting | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
distribution: ${{ matrix.java_distribution }} | |
java-version: ${{ matrix.java_version }} | |
cache: sbt | |
# Cache Action - tried on 2021-06-28, removed because it didn't help | |
# 1. Tried coursier/cache-action but Apache didn't allow it | |
# extraSbtFiles: daffodil-cli/build.sbt daffodil-japi/build.sbt | |
# 2. Tried actions/cache but it didn't speed up CI at all | |
# path: ~/.cache/coursier ~/.ivy2/cache ~/.sbt | |
############################################################ | |
# Build & Package | |
############################################################ | |
- name: Show Default Java CHarset | |
run: java -XshowSettings:properties -version 2>&1 | |
- name: Run Integration Tests | |
run: $SBT "daffodil-test-integration/test" | |