update snap build (#1404) #2674
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: "ubuntu" | |
permissions: {} | |
on: | |
push: | |
branches: [ '**'] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [ master ] | |
schedule: | |
- cron: '27 4 * * 2' | |
workflow_dispatch: | |
inputs: | |
attestation: | |
description: 'Generate attestation for binary artifacts' | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
ubuntu: | |
name: ubuntu Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# focal has Qt 5.12, end of standard support 4/2025, end of life 4/2030. | |
#- IMAGE: 'focal' | |
# SCRIPT: './tools/build_and_test_cmake.sh' | |
- IMAGE: 'jammy' | |
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6' | |
SCRIPT: './tools/build_and_test_cmake.sh' | |
- IMAGE: 'jammy' | |
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6' | |
SCRIPT: './tools/build_and_test_cmake.sh' | |
TOOLS: 'clang' | |
- IMAGE: 'noble' | |
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6' | |
SCRIPT: './tools/build_and_test_cmake.sh' | |
- IMAGE: 'noble' | |
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6' | |
SCRIPT: './tools/build_and_test_cmake.sh' | |
TOOLS: 'clang' | |
- IMAGE: 'noble' | |
CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt6' | |
SCRIPT: './tools/build_extra_tests.sh' | |
container: | |
image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_${{ matrix.IMAGE }} | |
env: | |
LC_ALL: 'C.UTF-8' | |
JOB_CMAKE_PREFIX_PATH: ${{ matrix.CMAKE_PREFIX_PATH }} | |
JOB_TOOLS: ${{ matrix.TOOLS }} | |
JOB_SCRIPT: ${{ matrix.SCRIPT }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: build_and_test | |
run: | | |
# when using containers manually whitelist the checkout directory to allow git commands to work | |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | |
if [ -n "${JOB_CMAKE_PREFIX_PATH}" ]; then | |
CMAKE_PREFIX_PATH="${JOB_CMAKE_PREFIX_PATH}" | |
export CMAKE_PREFIX_PATH | |
fi | |
if [ "${JOB_TOOLS}" = "clang" ]; then | |
CC=clang | |
export CC | |
CXX=clang++ | |
export CXX | |
fi | |
"${JOB_SCRIPT}" | |
ubuntu-arm: | |
name: ubuntu ARM Build | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- name: Install | |
run: | | |
# valgrind 1:3.22.0-0ubuntu3 and 3.23.0 have rounding problems with arm64 and our igc format. | |
# These are resolved in valgrind 3.24.0 which is in my ppa as 1:3.24.0-0ubuntu1~noble11. | |
sudo add-apt-repository ppa:tsteven4/valgrind-backports | |
sudo apt-get update | |
sudo apt-get install valgrind expat libxml2-utils | |
sudo apt-get install fop xsltproc docbook-xml docbook5-xml docbook-xsl docbook-xsl-ns libavalon-framework-java jing | |
sudo apt-get install libusb-1.0-0-dev libudev-dev | |
sudo apt-get install qt6-base-dev qt6-5compat-dev qt6-serialport-dev libx11-xcb-dev libxkbcommon-dev qt6-tools-dev qt6-translations-l10n qt6-webengine-dev qt6-wayland | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: build_and_test | |
run: | | |
# when using containers manually whitelist the checkout directory to allow git commands to work | |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | |
./tools/build_and_test_cmake.sh | |
coverage: | |
name: coverage Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: install | |
run: | | |
sudo apt-get update | |
sudo apt-get install gcovr lcov libusb-1.0-0-dev libgl-dev qt6-base-dev libqt6core5compat6-dev libqt6serialport6-dev qt6-webengine-dev qt6-webengine-dev-tools ninja-build | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: script | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
run: | | |
./tools/travis_script_linux_coverage | |
snap: | |
name: snap Build | |
permissions: | |
id-token: write | |
contents: write | |
attestations: write | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
- os: ubuntu-24.04-arm | |
outputs: | |
snap-file: ${{ steps.build-snap.outputs.snap }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build | |
uses: snapcore/action-build@v1 | |
id: build-snap | |
# Make sure the snap is installable | |
- name: Test | |
run: | | |
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }} | |
export GBTEMP=$(pwd)/gbtemp | |
mkdir -p "$GBTEMP" | |
/snap/bin/gpsbabel -D3 || true | |
./testo -p /snap/bin/gpsbabel | |
- name: Generate artifact attestation | |
if: ${{ inputs.attestation }} | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: ${{ steps.build-snap.outputs.snap }} | |
- name: Deploy | |
# This only handles continous releases now, for other events artifacts may be saved in | |
# the 'Upload Artifacts' step. | |
if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' ) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_NAME: Continuous-Linux | |
run: | | |
./tools/uploadtool/upload_github.sh ${{ steps.build-snap.outputs.snap }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.build-snap.outputs.snap }} | |
path: ${{ steps.build-snap.outputs.snap }} | |
retention-days: 7 |