Changes required for Debian 13 and ARM builds #3
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
name: CI | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
# https://github.community/t/how-to-use-env-with-container-image/17252/25 | |
image: | |
runs-on: ubuntu-latest | |
outputs: | |
var: ${{ steps.save_var.outputs.var }} | |
steps: | |
# https://github.com/docker/build-push-action/issues/424 | |
- name: downcase REPO | |
run: | | |
echo "IMAGE_NAME_LOWER=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- id: save_var | |
run: echo "::set-output name=var::${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}" | |
checkstyle: | |
runs-on: ubuntu-latest | |
needs: image | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Checkstyle | |
run: checkstyle -c config/checkstyle/checks.xml src/ | |
lineendings: | |
runs-on: ubuntu-latest | |
container: alpine | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Unix lineendings | |
run: | | |
apk add --no-cache file findutils | |
(! find -regex '.*\.\(css\|f?xml\|java\|md\|properties\|svg\|txt\)$' -type f -exec file '{}' \; | grep -F 'CRLF' ) | |
xmllint: | |
runs-on: ubuntu-latest | |
container: alpine | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Ensure that the FXML Java versions matches the system verison to avoid warnings | |
run: | | |
apk add --no-cache findutils libxml2-utils | |
find -regex '.*\.f?xml$' -type f -exec xmllint --format --noout '{}' \; | |
find src/main/resources/fxml -not \( -name controls -prune \) -type f -name '*.fxml' | xargs -t -L1 xmllint --xpath '/*[namespace-uri()="http://javafx.com/javafx/11"]' > /dev/null | |
nbproperties: | |
runs-on: ubuntu-latest | |
needs: image | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Adjust paths for CI environment | |
run: | | |
mkdir -p nbproject/private | |
cat << EOF > nbproject/private/private.properties | |
project.JBackpack=jbackpack | |
project.lernstickTools=lernstickTools | |
reference.lernstickTools.jar=\${project.lernstickTools}/build/libs/lernstickTools.jar | |
EOF | |
- name: Upload properties | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nbproperties | |
path: nbproject/private/private.properties | |
build_lernstickTools: | |
runs-on: ubuntu-latest | |
needs: image | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
repository: Lernstick/lernstickTools | |
path: lernstickTools | |
fetch-depth: 1 | |
- name: Build lernstickTools | |
run: | | |
cd lernstickTools | |
gradle build | |
- name: Upload lernstickTools | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lernstickTools | |
path: lernstickTools | |
build_jbackpack: | |
runs-on: ubuntu-latest | |
needs: image | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
repository: Lernstick/jbackpack | |
path: jbackpack | |
fetch-depth: 1 | |
- name: Build jbackpack | |
run: | | |
cd jbackpack | |
ant jar | |
- name: Upload jbackpack | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jbackpack | |
path: jbackpack | |
build_DLCopy: | |
runs-on: ubuntu-latest | |
needs: [image,build_jbackpack,build_lernstickTools,nbproperties] | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Fetch jbackpack | |
uses: actions/download-artifact@v3 | |
with: | |
name: jbackpack | |
path: jbackpack | |
- name: Fetch lernstickTools | |
uses: actions/download-artifact@v3 | |
with: | |
name: lernstickTools | |
path: lernstickTools | |
- name: Fetch nbproperties | |
uses: actions/download-artifact@v3 | |
with: | |
name: nbproperties | |
path: nbproject/private | |
- name: Build DLCopy | |
run: ant jar | |
- name: Upload DLCopy | |
uses: actions/upload-artifact@v3 | |
with: | |
name: DLCopy | |
path: dist | |
build_DLCopy_javadoc: | |
runs-on: ubuntu-latest | |
needs: [image,build_jbackpack,build_lernstickTools,nbproperties] | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Fetch jbackpack | |
uses: actions/download-artifact@v3 | |
with: | |
name: jbackpack | |
path: jbackpack | |
- name: Fetch lernstickTools | |
uses: actions/download-artifact@v3 | |
with: | |
name: lernstickTools | |
path: lernstickTools | |
- name: Fetch nbproperties | |
uses: actions/download-artifact@v3 | |
with: | |
name: nbproperties | |
path: nbproject/private | |
- name: Build Javadoc | |
run: ant javadoc | |
- name: Upload Javadoc | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Javadoc | |
path: dist/javadoc | |
build_DLCopy_deb: | |
runs-on: ubuntu-latest | |
needs: [image,build_DLCopy,build_DLCopy_javadoc] | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Fetch jbackpack | |
uses: actions/download-artifact@v3 | |
with: | |
name: jbackpack | |
path: jbackpack | |
- name: Fetch lernstickTools | |
uses: actions/download-artifact@v3 | |
with: | |
name: lernstickTools | |
path: lernstickTools | |
- name: Fetch nbproperties | |
uses: actions/download-artifact@v3 | |
with: | |
name: nbproperties | |
path: nbproject/private | |
- name: Fetch Javadoc | |
uses: actions/download-artifact@v3 | |
with: | |
name: Javadoc | |
path: dist/javadoc | |
- name: Fetch DLCopy | |
uses: actions/download-artifact@v3 | |
with: | |
name: DLCopy | |
path: dist | |
- name: Build Debian package | |
run: | | |
apt-get update | |
apt-get install -y --no-install-recommends build-essential debhelper junit | |
dpkg-buildpackage --no-sign | |
mkdir dpkg | |
mv ../dlcopy* dpkg/ | |
- name: Upload Debian package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Debian | |
path: dpkg | |
testfx: | |
runs-on: ubuntu-latest | |
needs: [image,build_DLCopy,build_DLCopy_javadoc] | |
container: | |
image: ${{ needs.image.outputs.var }} | |
steps: | |
- name: Checkout HEAD | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Fetch jbackpack | |
uses: actions/download-artifact@v3 | |
with: | |
name: jbackpack | |
path: jbackpack | |
- name: Fetch lernstickTools | |
uses: actions/download-artifact@v3 | |
with: | |
name: lernstickTools | |
path: lernstickTools | |
- name: Fetch nbproperties | |
uses: actions/download-artifact@v3 | |
with: | |
name: nbproperties | |
path: nbproject/private | |
- name: Fetch Javadoc | |
uses: actions/download-artifact@v3 | |
with: | |
name: Javadoc | |
path: dist/javadoc | |
- name: Fetch DLCopy | |
uses: actions/download-artifact@v3 | |
with: | |
name: DLCopy | |
path: dist | |
- name: Run TestFX | |
run: | | |
apt-get update | |
apt-get install -y --no-install-recommends junit libmockito-java xauth xvfb | |
# Create files for tricking DLCopy into thinking to run on a Lerstick instance | |
# See `src/main/java/ch/fhnw/dlcopy/DebianLiveVersion.java` for more infomration | |
mkdir -pv /run/live/medium | |
mkdir -pv /usr/lib/syslinux/mbr | |
touch /usr/lib/syslinux/mbr/mbr.bin | |
xvfb-run ant test |