aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2021-09-08 02:10:15 +0200
committerGuillem Jover <guillem@hadrons.org>2021-09-13 13:23:04 +0200
commiteb6f8905db08130242dd02df0583107feccfe6fb (patch)
treeb27f9469a8c66e5a38fef58bdfd8533dd4a81ce8 /.github
parenta8feca92ea9613e05acc7b7f4713071e36a4fe9a (diff)
downloadliburing-eb6f8905db08130242dd02df0583107feccfe6fb.tar.gz
.github/workflows: Simplify and unify build tests
- Use a single definition for both gcc and clang tests, by using a matrix. - Remove redundant installation for packages present in the CI system. - Remove version printing for uninteresting programs. - Trigger for all branches, so that MRs can see results on non-master. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml40
-rw-r--r--.github/workflows/build_with_clang.yml37
-rw-r--r--.github/workflows/build_with_gcc.yml32
3 files changed, 40 insertions, 69 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..432dbb6
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,40 @@
+name: Build test
+
+on:
+ # Trigger the workflow on push or pull requests.
+ push:
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - cc: gcc
+ cxx: g++
+ - cc: clang
+ cxx: clang++
+
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@v2
+
+ - name: Display compiler versions
+ run: |
+ ${{matrix.cc}} --version
+ ${{matrix.cxx}} --version
+
+ - name: Build
+ run: |
+ ./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}}
+ make V=1 -j$(nproc) \
+ CPPFLAGS="-Werror" \
+ CFLAGS="-Werror" \
+ CXXFLAGS="-Werror"
+
+ - name: Test install command
+ run: |
+ sudo make install
diff --git a/.github/workflows/build_with_clang.yml b/.github/workflows/build_with_clang.yml
deleted file mode 100644
index ce6707e..0000000
--- a/.github/workflows/build_with_clang.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: Build with Clang
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-jobs:
- main:
- name: Build with Clang
- strategy:
- fail-fast: false
-
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - name: Install Toolchains
- run: |
- sudo apt-get install -y man git clang make && \
- git --version && \
- clang --version && \
- clang++ --version && \
- make --version;
-
- - name: Build
- run: |
- make -j$(nproc) V=1 \
- CFLAGS="-Werror" \
- CPPFLAGS="-Werror" \
- CXXFLAGS="-Werror" \
- CC=clang \
- CXX=clang++;
-
- - name: Test install command
- run: sudo make install;
diff --git a/.github/workflows/build_with_gcc.yml b/.github/workflows/build_with_gcc.yml
deleted file mode 100644
index 7c2e103..0000000
--- a/.github/workflows/build_with_gcc.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Build with GCC
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
-jobs:
- main:
- name: Build with GCC
- strategy:
- fail-fast: false
-
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - name: Install Toolchains
- run: |
- sudo apt-get install -y man git gcc g++ make && \
- git --version && \
- gcc --version && \
- g++ --version && \
- make --version;
-
- - name: Build
- run: |
- make -j$(nproc) V=1 CFLAGS="-Werror" CPPFLAGS="-Werror" CXXFLAGS="-Werror" CC=gcc CXX=g++;
-
- - name: Test install command
- run: sudo make install;