aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/linux.yml
blob: d693f5e593a4b5de931a81225a5e883b9ae64670 (plain) (blame)
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
56
57
58
59
60
61
name: Linux CI
on: [push, pull_request]

jobs:
  linux:
    name: ${{ matrix.flavor }} (cc=${{ matrix.cc }})
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - flavor: asan
            cc: clang-11
          - flavor: lint
            cc: gcc
          - flavor: tsan
            cc: clang-11
    env:
      CC: ${{ matrix.cc }}
    steps:
      - uses: actions/checkout@v2

      - name: Setup commom environment variables
        run: ./.github/workflows/env.sh ${{ matrix.flavor }}

      - name: Setup clang repository
        if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
        run: |
          wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
          sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'

      - name: Install apt packages
        run: |
          sudo apt-get update
          sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python python-pip python-setuptools python3 python3-pip python3-setuptools unzip valgrind xclip

      - name: Install new clang
        if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
        run: sudo apt-get install -y clang-11

      - name: Setup interpreter packages
        run: |
          ./ci/before_install.sh
          ./ci/install.sh

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: |
            ${{ env.CACHE_NVIM_DEPS_DIR }}
            ~/.ccache
          key: ${{ runner.os }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}

      - name: Build third-party
        run: ./ci/before_script.sh

      - name: Build and test
        run: ./ci/script.sh

      - name: Cache dependencies
        if: ${{ success() }}
        run: ./ci/before_cache.sh