forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (50 loc) · 1.72 KB
/
gcc.yml
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
---
name: GCC C/C++ standards check
on:
- push
jobs:
build:
name: ${{ matrix.c }} & ${{ matrix.cpp }}
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
matrix.c }}-${{ matrix.cpp }}
cancel-in-progress: true
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- c: gnu11
cpp: c++11
fail-fast: false
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Get dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Create installation directory
run: |
mkdir $HOME/install
- name: Ensure one core for compilation
run: |
echo "MAKEFLAGS=-j1" >> $GITHUB_ENV
- name: Set LD_LIBRARY_PATH for compilation
run: |
echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
- name: Print build environment variables
shell: bash -el {0}
run: |
printenv | sort
gcc --version
ldd --version
- name: Build
env:
# TODO: -pedantic-errors here won't go through ./configure (with GNU C)
CFLAGS: -std=${{ matrix.c }} -fPIC -Wall -Wextra
# TODO: -pedantic-errors here won't compile
CXXFLAGS: -std=${{ matrix.cpp }} -fPIC -Wall -Wextra
run: |
.github/workflows/build_ubuntu-22.04.sh $HOME/install \
-isystem/usr/include/gdal -Wpedantic -Werror