aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-11-27 00:36:52 +0100
committerGitHub <noreply@github.com>2020-11-27 00:36:52 +0100
commit968b06fbb6cb96e8e4400d9c93c6778eaccb96fa (patch)
treee180af0c297f26215ce4fd45248626a11cbc48e5
parent74944e3af4278b52a5eef5c4ed17fd04558fb805 (diff)
parentf0842bb0b079801d9457579013e8aea5616d5f77 (diff)
downloadPROJ-968b06fbb6cb96e8e4400d9c93c6778eaccb96fa.tar.gz
PROJ-968b06fbb6cb96e8e4400d9c93c6778eaccb96fa.zip
Merge pull request #2457 from rouault/gha_linux_clang
Move linux_clang Travis-CI job to Github action
-rw-r--r--.github/workflows/clang_linux.yml24
-rwxr-xr-x.github/workflows/clang_linux/start.sh32
-rw-r--r--.travis.yml9
-rwxr-xr-xtravis/install.sh5
-rwxr-xr-xtravis/linux_clang/after_success.sh5
-rwxr-xr-xtravis/linux_clang/before_install.sh8
-rwxr-xr-xtravis/linux_clang/install.sh9
7 files changed, 59 insertions, 33 deletions
diff --git a/.github/workflows/clang_linux.yml b/.github/workflows/clang_linux.yml
new file mode 100644
index 00000000..ba52cc95
--- /dev/null
+++ b/.github/workflows/clang_linux.yml
@@ -0,0 +1,24 @@
+name: CLang Linux
+
+on: [push, pull_request]
+
+jobs:
+
+ clang_linux:
+ runs-on: ubuntu-latest
+ if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Cache
+ uses: actions/cache@v2
+ id: cache
+ with:
+ path: |
+ ${{ github.workspace }}/ccache.tar.gz
+ key: ${{ runner.os }}-cache-clang-${{ github.run_id }}
+ restore-keys: ${{ runner.os }}-cache-clang-
+
+ - name: Run
+ run: docker run -e CI -e TRAVIS_BUILD_DIR="$PWD" -e WORK_DIR="$PWD" -e TRAVIS_OS_NAME=linux -e BUILD_NAME=linux_clang -v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/clang_linux/start.sh
diff --git a/.github/workflows/clang_linux/start.sh b/.github/workflows/clang_linux/start.sh
new file mode 100755
index 00000000..83d2f8c2
--- /dev/null
+++ b/.github/workflows/clang_linux/start.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+apt-get update -y
+DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ sudo autoconf automake libtool clang++-10 python3-clang-10 make cmake ccache pkg-config tar zip \
+ sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev jq python3-pip
+
+pip3 install --user jsonschema
+
+cd "$WORK_DIR"
+
+if test -f "$WORK_DIR/ccache.tar.gz"; then
+ echo "Restoring ccache..."
+ (cd $HOME && tar xzf "$WORK_DIR/ccache.tar.gz")
+fi
+
+export CCACHE_CPP2=yes
+export PROJ_DB_CACHE_DIR="$HOME/.ccache"
+
+ccache -M 500M
+ccache -s
+
+# -fno-use-cxa-atexit is needed to build with -coverage
+CC="ccache clang-10" CXX="ccache clang++-10" CFLAGS="-Werror -fsanitize=address -fno-use-cxa-atexit" CXXFLAGS="-Werror -fsanitize=address -fno-use-cxa-atexit" LDFLAGS="-fsanitize=address" ./travis/install.sh
+
+ccache -s
+
+echo "Saving ccache..."
+rm -f "$WORK_DIR/ccache.tar.gz"
+(cd $HOME && tar czf "$WORK_DIR/ccache.tar.gz" .ccache)
diff --git a/.travis.yml b/.travis.yml
index a258ee2e..f0720523 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,15 +58,6 @@ matrix:
- automake
- os: linux
- dist: xenial
- compiler: clang
- services:
- - docker
- env:
- - BUILD_NAME=linux_clang
- - DETAILS="linux, clang"
-
- - os: linux
dist: bionic
compiler: gcc
arch: s390x
diff --git a/travis/install.sh b/travis/install.sh
index 8897f823..a4d8352a 100755
--- a/travis/install.sh
+++ b/travis/install.sh
@@ -41,8 +41,9 @@ make >/dev/null
if [ "$(uname)" == "Linux" -a -f src/.libs/libproj.so ]; then
if objdump -TC "src/.libs/libproj.so" | grep "elf64-x86-64">/dev/null; then
echo "Checking exported symbols..."
- $TRAVIS_BUILD_DIR/scripts/dump_exported_symbols.sh src/.libs/libproj.so > /tmp/got_symbols.txt
- diff -u $TRAVIS_BUILD_DIR/scripts/reference_exported_symbols.txt /tmp/got_symbols.txt || (echo "Difference(s) found in exported symbols. If intended, refresh scripts/reference_exported_symbols.txt with 'scripts/dump_exported_symbols.sh src/.libs/libproj.so > scripts/reference_exported_symbols.txt'"; exit 1)
+ cat $TRAVIS_BUILD_DIR/scripts/reference_exported_symbols.txt | sort > /tmp/reference_exported_symbols.txt
+ $TRAVIS_BUILD_DIR/scripts/dump_exported_symbols.sh src/.libs/libproj.so | sort > /tmp/got_symbols.txt
+ diff -u /tmp/reference_exported_symbols.txt /tmp/got_symbols.txt || (echo "Difference(s) found in exported symbols. If intended, refresh scripts/reference_exported_symbols.txt with 'scripts/dump_exported_symbols.sh src/.libs/libproj.so > scripts/reference_exported_symbols.txt'"; exit 1)
fi
fi
diff --git a/travis/linux_clang/after_success.sh b/travis/linux_clang/after_success.sh
deleted file mode 100755
index 9618f673..00000000
--- a/travis/linux_clang/after_success.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# nothing
diff --git a/travis/linux_clang/before_install.sh b/travis/linux_clang/before_install.sh
deleted file mode 100755
index c4b8acad..00000000
--- a/travis/linux_clang/before_install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-set -e
-
-./travis/before_install_apt.sh
-./travis/before_install_pip.sh
-
-sudo apt-get install -qq sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev
diff --git a/travis/linux_clang/install.sh b/travis/linux_clang/install.sh
deleted file mode 100755
index 50c02882..00000000
--- a/travis/linux_clang/install.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-set -e
-
-export CCACHE_CPP2=yes
-export PROJ_DB_CACHE_DIR="$HOME/.ccache"
-
-# -fno-use-cxa-atexit is needed to build with -coverage
-CC="ccache clang" CXX="ccache clang++" CFLAGS="-Werror -fsanitize=address -fno-use-cxa-atexit" CXXFLAGS="-Werror -fsanitize=address -fno-use-cxa-atexit" LDFLAGS="-fsanitize=address" ./travis/install.sh