-
-
Notifications
You must be signed in to change notification settings - Fork 127
63 lines (57 loc) · 2 KB
/
compile.yml
File metadata and controls
63 lines (57 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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-22.04, ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-22.04
triplet: x64-linux
- os: macos-latest
triplet: x64-osx
steps:
- name: Clone repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
# Install CMake
- uses: lukka/get-cmake@2ecc21724e5215b0e567bc399a2602d2ecb48541 # v4.1.1
# Install NASM
- uses: ilammy/setup-nasm@72793074d3c8cdda771dba85f6deafe00623038b # v1.5.2
# Launch the MSVC Tools Command Prompt (Windows)
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
# 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: matrix.os != 'ubuntu-latest'
with:
name: jpegoptim-${{ matrix.triplet }}
path: build/dist