123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- name: compile
- on:
- push:
- branches:
- - "**"
- - "!dependabot/**"
- pull_request:
- workflow_dispatch:
- jobs:
- job:
- name: ${{ matrix.os }}-${{ github.workflow }}
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
- include:
- - os: windows-latest
- triplet: x64-windows
- - os: ubuntu-20.04
- triplet: x64-linux
- - os: macos-latest
- triplet: x64-osx
- steps:
- - name: Clone repository
- uses: actions/checkout@v4
- with:
- persist-credentials: false
- # Install CMake
- - uses: lukka/get-cmake@v3.30.1
- # Install NASM
- - uses: ilammy/setup-nasm@v1
- # Launch the MSVC Tools Command Prompt (Windows)
- - uses: ilammy/msvc-dev-cmd@v1
- # Initialize the CMake directory and build
- - name: Build
- run: |
- cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_NO_SUBFOLDERS=1
- cmake --build build --config Release
- # Run tests
- - name: Tests
- run: |
- ctest --output-on-failure --test-dir build --build-config Release
- # Gather documentation and executables to a common directory
- # Ignore copying errors from only one of build/jpegoptim or build/jpegoptim.exe existing
- - name: Prepare files
- if: matrix.os != 'ubuntu-latest'
- run: |
- mkdir build/dist
- cp build/jpegoptim build/jpegoptim.exe COPYRIGHT LICENSE README build/dist/ 2>/dev/null || true
- shell: bash
- # Upload the compiled binary
- - uses: actions/upload-artifact@v4
- if: matrix.os != 'ubuntu-latest'
- with:
- name: jpegoptim-${{ matrix.triplet }}
- path: build/dist
|