Skip to content

Commit a49bda8

Browse files
committed
Fix indentation in Github Actions config and improve naming of jobs
1 parent 82c7f2d commit a49bda8

File tree

1 file changed

+115
-108
lines changed

1 file changed

+115
-108
lines changed

.github/workflows/build.yml

Lines changed: 115 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ on:
33
pull_request:
44
push:
55
schedule:
6-
- cron: '0 0 1 * *'
6+
- cron: '0 0 1 * *'
77

88
env:
99
COMMONFLAGS: '-Wall -Wextra -pedantic -Werror'
1010

1111
jobs:
1212
build:
13+
name: >
14+
${{ matrix.os }}, ${{ matrix.compiler }}${{
15+
matrix.version && format('-{0}', matrix.version) || ''
16+
}}${{
17+
matrix.extra-desc && format(', {0}', matrix.extra-desc) || ''
18+
}}
1319
runs-on: ${{ matrix.os }}
1420
strategy:
1521
matrix:
@@ -32,121 +38,122 @@ jobs:
3238
- {os: ubuntu-latest, compiler: clang, version: '10'}
3339

3440
# Windows builds
35-
- {os: windows-2016, version: '14.16'}
36-
- {os: windows-latest, version: '14.27'}
41+
- {os: windows-2016, compiler: msvc, version: '14.16'}
42+
- {os: windows-latest, compiler: msvc, version: '14.27'}
3743

3844
# macOS builds
39-
- {os: macos-latest}
45+
- {os: macos-latest, compiler: clang}
4046

4147
# C++20 builds
4248
- {os: ubuntu-latest, compiler: gcc, version: '10',
4349
options: '--std=c++2a', flags: '-Wsuggest-override',
44-
boost-source: '1.74.0'}
50+
boost-source: '1.74.0', extra-desc: 'c++20'}
4551
- {os: ubuntu-latest, compiler: clang, version: '10',
46-
options: '--std=c++2a', boost-source: '1.74.0'}
52+
options: '--std=c++2a', boost-source: '1.74.0',
53+
extra-desc: 'c++20'}
4754
fail-fast: false
4855

4956
steps:
50-
- uses: actions/checkout@v2
51-
- name: Set up Python 3.8
52-
uses: actions/setup-python@v1
53-
with:
54-
python-version: 3.8
55-
- name: Install Python dependencies
56-
run: |
57-
pip install bfg9000
58-
- name: Install Linux dependencies
59-
if: startsWith(matrix.os, 'ubuntu-')
60-
run: >
61-
sudo apt-get install
62-
ninja-build
63-
libboost-dev
64-
libboost-iostreams-dev
65-
libboost-program-options-dev
66-
- name: Install Windows dependencies
67-
if: startsWith(matrix.os, 'windows-')
68-
run: |
69-
cinst ninja
70-
${gnomebase} = "https://ftp.gnome.org/pub/gnome/binaries/win32"
71-
curl -LO ${gnomebase}/dependencies/pkg-config_0.26-1_win32.zip
72-
curl -LO ${gnomebase}/glib/2.28/glib_2.28.8-1_win32.zip
73-
curl -LO ${gnomebase}/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
74-
7z x -y pkg-config_0.26-1_win32.zip -oC:\pkg-config
75-
7z x -y glib_2.28.8-1_win32.zip -oC:\pkg-config
76-
7z x -y gettext-runtime_0.18.1.1-2_win32.zip -oC:\pkg-config
77-
echo "PKG_CONFIG=C:\pkg-config\bin\pkg-config.exe" >> ${env:GITHUB_ENV}
57+
- uses: actions/checkout@v2
58+
- name: Set up Python 3.8
59+
uses: actions/setup-python@v1
60+
with:
61+
python-version: 3.8
62+
- name: Install Python dependencies
63+
run: |
64+
pip install bfg9000
65+
- name: Install Linux dependencies
66+
if: startsWith(matrix.os, 'ubuntu-')
67+
run: >
68+
sudo apt-get install
69+
ninja-build
70+
libboost-dev
71+
libboost-iostreams-dev
72+
libboost-program-options-dev
73+
- name: Install Windows dependencies
74+
if: startsWith(matrix.os, 'windows-')
75+
run: |
76+
cinst ninja
77+
${gnomebase} = "https://ftp.gnome.org/pub/gnome/binaries/win32"
78+
curl -LO ${gnomebase}/dependencies/pkg-config_0.26-1_win32.zip
79+
curl -LO ${gnomebase}/glib/2.28/glib_2.28.8-1_win32.zip
80+
curl -LO ${gnomebase}/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
81+
7z x -y pkg-config_0.26-1_win32.zip -oC:\pkg-config
82+
7z x -y glib_2.28.8-1_win32.zip -oC:\pkg-config
83+
7z x -y gettext-runtime_0.18.1.1-2_win32.zip -oC:\pkg-config
84+
echo "PKG_CONFIG=C:\pkg-config\bin\pkg-config.exe" >> ${env:GITHUB_ENV}
7885
79-
${boostroot} = "${env:BOOST_ROOT_1_72_0}"
80-
echo "BOOST_INCLUDEDIR=${boostroot}\include" >> ${env:GITHUB_ENV}
81-
echo "BOOST_LIBRARYDIR=${boostroot}\lib" >> ${env:GITHUB_ENV}
82-
- name: Install macOS dependencies
83-
if: startsWith(matrix.os, 'macos-')
84-
run: |
85-
brew install ninja pkg-config boost
86-
- name: Install Boost ${{ matrix.boost-source }}
87-
if: matrix.boost-source
88-
run: |
89-
export SRCDIR=boost_`echo ${{ matrix.boost-source }} | sed 's/\./_/g'`
90-
curl -LO https://dl.bintray.com/boostorg/release/${{ matrix.boost-source }}/source/${SRCDIR}.tar.bz2
91-
tar -xjf ${SRCDIR}.tar.bz2
92-
pushd ${SRCDIR}
93-
./bootstrap.sh --prefix=${HOME} --with-libraries=program_options,iostreams
94-
./b2 link=shared threading=multi variant=release -d0
95-
./b2 install -d0
96-
popd
97-
echo "BOOST_ROOT=${HOME}" >> ${GITHUB_ENV}
98-
- name: Install gcc
99-
if: matrix.compiler == 'gcc'
100-
run: |
101-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
102-
sudo apt-get update
103-
sudo apt-get install g++-${{ matrix.version }}
104-
echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV}
105-
- name: Install clang
106-
if: matrix.compiler == 'clang'
107-
run: |
108-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
109-
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${{ matrix.version }} main"
110-
sudo apt-get update
111-
sudo apt-get install clang-${{ matrix.version }}
112-
echo "CXX=clang++-${{ matrix.version }}" >> ${GITHUB_ENV}
113-
- name: Initialize MSVC ${{ matrix.version }}
114-
if: startsWith(matrix.os, 'windows-')
115-
uses: ilammy/msvc-dev-cmd@v1
116-
with:
117-
toolset: ${{ matrix.version }}
118-
- name: Clone mettle
119-
uses: actions/checkout@v2
120-
with:
121-
repository: jimporter/mettle
122-
path: mettle
123-
- name: Build mettle
124-
if: "!startsWith(matrix.os, 'windows-')"
125-
run: |
126-
pushd mettle
127-
CPATH="`pwd`/../include" 9k build --backend=ninja --prefix=${HOME}
128-
cd build
129-
ninja install
130-
popd
131-
echo "PATH=${HOME}/bin:${PATH}" >> ${GITHUB_ENV}
132-
echo "CPATH=${HOME}/include" >> ${GITHUB_ENV}
133-
echo "PKG_CONFIG_PATH=${HOME}/lib/pkgconfig" >> ${GITHUB_ENV}
134-
echo "CXXFLAGS=${COMMONFLAGS} ${{ matrix.flags }}" >> ${GITHUB_ENV}
135-
- name: Build mettle (Windows)
136-
if: startsWith(matrix.os, 'windows-')
137-
run: |
138-
${env:CPATH} = "${pwd}\include"
139-
pushd mettle
140-
9k build --backend=ninja --prefix=$env:HOME\mettle
141-
cd build
142-
ninja install
143-
popd
144-
echo "PATH=${env:HOME}\mettle;${env:PATH}" >> ${env:GITHUB_ENV}
145-
echo "CPATH=${env:HOME}\mettle" >> ${env:GITHUB_ENV}
146-
echo "PKG_CONFIG_PATH=${env:HOME}\mettle\pkgconfig" >> ${env:GITHUB_ENV}
147-
echo "CXXFLAGS=/WX ${{ matrix.flags }}" >> ${env:GITHUB_ENV}
148-
- name: Run tests
149-
run: |
150-
9k build --backend=ninja ${{ matrix.options }}
151-
cd build
152-
ninja test
86+
${boostroot} = "${env:BOOST_ROOT_1_72_0}"
87+
echo "BOOST_INCLUDEDIR=${boostroot}\include" >> ${env:GITHUB_ENV}
88+
echo "BOOST_LIBRARYDIR=${boostroot}\lib" >> ${env:GITHUB_ENV}
89+
- name: Install macOS dependencies
90+
if: startsWith(matrix.os, 'macos-')
91+
run: |
92+
brew install ninja pkg-config boost
93+
- name: Install Boost ${{ matrix.boost-source }}
94+
if: matrix.boost-source
95+
run: |
96+
export SRCDIR=boost_`echo ${{ matrix.boost-source }} | sed 's/\./_/g'`
97+
curl -LO https://dl.bintray.com/boostorg/release/${{ matrix.boost-source }}/source/${SRCDIR}.tar.bz2
98+
tar -xjf ${SRCDIR}.tar.bz2
99+
pushd ${SRCDIR}
100+
./bootstrap.sh --prefix=${HOME} --with-libraries=program_options,iostreams
101+
./b2 link=shared threading=multi variant=release -d0
102+
./b2 install -d0
103+
popd
104+
echo "BOOST_ROOT=${HOME}" >> ${GITHUB_ENV}
105+
- name: Install gcc
106+
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'gcc'
107+
run: |
108+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
109+
sudo apt-get update
110+
sudo apt-get install g++-${{ matrix.version }}
111+
echo "CXX=g++-${{ matrix.version }}" >> ${GITHUB_ENV}
112+
- name: Install clang
113+
if: startsWith(matrix.os, 'ubuntu-') && matrix.compiler == 'clang'
114+
run: |
115+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
116+
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${{ matrix.version }} main"
117+
sudo apt-get update
118+
sudo apt-get install clang-${{ matrix.version }}
119+
echo "CXX=clang++-${{ matrix.version }}" >> ${GITHUB_ENV}
120+
- name: Initialize MSVC ${{ matrix.version }}
121+
if: startsWith(matrix.os, 'windows-')
122+
uses: ilammy/msvc-dev-cmd@v1
123+
with:
124+
toolset: ${{ matrix.version }}
125+
- name: Clone mettle
126+
uses: actions/checkout@v2
127+
with:
128+
repository: jimporter/mettle
129+
path: mettle
130+
- name: Build mettle
131+
if: "!startsWith(matrix.os, 'windows-')"
132+
run: |
133+
pushd mettle
134+
CPATH="`pwd`/../include" 9k build --backend=ninja --prefix=${HOME}
135+
cd build
136+
ninja install
137+
popd
138+
echo "PATH=${HOME}/bin:${PATH}" >> ${GITHUB_ENV}
139+
echo "CPATH=${HOME}/include" >> ${GITHUB_ENV}
140+
echo "PKG_CONFIG_PATH=${HOME}/lib/pkgconfig" >> ${GITHUB_ENV}
141+
echo "CXXFLAGS=${COMMONFLAGS} ${{ matrix.flags }}" >> ${GITHUB_ENV}
142+
- name: Build mettle (Windows)
143+
if: startsWith(matrix.os, 'windows-')
144+
run: |
145+
${env:CPATH} = "${pwd}\include"
146+
pushd mettle
147+
9k build --backend=ninja --prefix=$env:HOME\mettle
148+
cd build
149+
ninja install
150+
popd
151+
echo "PATH=${env:HOME}\mettle;${env:PATH}" >> ${env:GITHUB_ENV}
152+
echo "CPATH=${env:HOME}\mettle" >> ${env:GITHUB_ENV}
153+
echo "PKG_CONFIG_PATH=${env:HOME}\mettle\pkgconfig" >> ${env:GITHUB_ENV}
154+
echo "CXXFLAGS=/WX ${{ matrix.flags }}" >> ${env:GITHUB_ENV}
155+
- name: Run tests
156+
run: |
157+
9k build --backend=ninja ${{ matrix.options }}
158+
cd build
159+
ninja test

0 commit comments

Comments
 (0)