Commit 5b7c1c65 authored by Pádraig Ó Conbhuí's avatar Pádraig Ó Conbhuí
Browse files

Add Gitlab CI

Change Log:
* Add .gitlab-ci.yml and CI scripts under tests/ci.
* Add CI tests for lint.sh, format.sh, and unit tests
* Fix missing headers
* Drop CMake version to 3.13 for Ubuntu 19.04
parent e291b255
Pipeline #611 passed with stages
in 2 minutes and 18 seconds
.job_defaults:
image: ubuntu:19.04
tags:
- docker
stages:
- Static Analysis
- Dynamic Analysis
include:
- "/tests/ci/format-ci.yml"
- "/tests/ci/lint-ci.yml"
- "/tests/ci/dynamic-analysis-ci.yml"
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.13)
project(
magedep
......
......@@ -2,6 +2,7 @@
#define MEGADEP_BIDIRECTIONAL_INDEX_MAP
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
#include <optional>
......
#include <megadep/config.hpp>
#include <megadep/filesystem.hpp>
#include <algorithm>
#include <array>
#include <cassert>
#include <cerrno>
......
......@@ -7,6 +7,7 @@
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
......@@ -96,6 +97,7 @@ TEST_CASE(
"<algorithm>",
"<array>",
"<cstdio>",
"<cstring>",
"<string>",
"<vector>"};
......
.dynamic_analysis_job:
extends: .job_defaults
stage: Dynamic Analysis
before_script:
- apt-get update
- apt-get install -y
cmake
g++ clang
script:
- cmake -B build
-DCMAKE_CXX_COMPILER=${CXX}
-DCMAKE_VERBOSE_MAKEFILE=ON
- cmake --build build
- cmake --build build --target test -- ARGS=-V
gcc:
extends: .dynamic_analysis_job
variables:
CXX: g++
clang:
extends: .dynamic_analysis_job
variables:
CXX: clang++
Format:
extends: .job_defaults
stage: Static Analysis
before_script:
- apt-get update
- apt-get install -y
clang-format
git
script:
- ./tools/format.sh
&& git status --porcelain
&& git diff-index --quiet HEAD
|| {
echo;
echo "This commit contains unformatted files!";
echo "Run tools/format.sh on the project to format them correctly.";
echo;
false;
}
Lint:
extends: .job_defaults
stage: Static Analysis
before_script:
- apt-get update
- apt-get install -y
clang
clang-tidy
cmake
script:
- cmake -B build
- ./tools/lint.sh -p build
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment