xref: /OpenGrok/.github/workflows/build.yml (revision 895e2a5c452f328727e20ce98d041f5cd415bb66)
109df3f40SVladimir Kotalname: Build
2859d8bc6SVladimir Kotal
33772ba07SVladimir Kotalon:
43772ba07SVladimir Kotal  push:
53772ba07SVladimir Kotal    paths-ignore:
63772ba07SVladimir Kotal    - README.md
73772ba07SVladimir Kotal    - '**/*.md'
83772ba07SVladimir Kotal  pull_request:
93772ba07SVladimir Kotal  schedule:
103772ba07SVladimir Kotal  - cron: "0 0 * * 0"
11859d8bc6SVladimir Kotal
1209df3f40SVladimir Kotaljobs:
134eaccc42SVladimir Kotal  build:
14d5760439SVladimir Kotal    name: ${{ matrix.os }} with Java 11
15d5760439SVladimir Kotal    runs-on: ${{ matrix.os }}
16d5760439SVladimir Kotal    strategy:
17d5760439SVladimir Kotal      fail-fast: false
18d5760439SVladimir Kotal      matrix:
19d5760439SVladimir Kotal        os: [ubuntu-latest, macos-latest, windows-latest]
2009df3f40SVladimir Kotal    steps:
2109df3f40SVladimir Kotal    - name: Checkout master branch
2209df3f40SVladimir Kotal      uses: actions/checkout@v2
23*895e2a5cSVladimir Kotal      with:
24*895e2a5cSVladimir Kotal        fetch-depth: 0
254bf269d3SVladimir Kotal    - name: Set up JDK 11
264bf269d3SVladimir Kotal      uses: actions/setup-java@v1
274bf269d3SVladimir Kotal      with:
284bf269d3SVladimir Kotal        java-version: 11
2974a6b545SVladimir Kotal    - name: Cache Maven packages
3074a6b545SVladimir Kotal      uses: actions/cache@v2
3174a6b545SVladimir Kotal      with:
3274a6b545SVladimir Kotal        path: ~/.m2
3374a6b545SVladimir Kotal        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3474a6b545SVladimir Kotal        restore-keys: ${{ runner.os }}-m2
353ae39b59SVladimir Kotal    - name: Checkout Universal ctags
363ae39b59SVladimir Kotal      uses: actions/checkout@v2
373ae39b59SVladimir Kotal      with:
383ae39b59SVladimir Kotal        repository: universal-ctags/ctags
393ae39b59SVladimir Kotal        path: ctags
40ff606017SVladimir Kotal    - name: Install pre-requisites (Unix)
41d5760439SVladimir Kotal      if: runner.os == 'Linux' || runner.os == 'macOS'
42ff606017SVladimir Kotal      run: ./dev/before_install
43d5760439SVladimir Kotal    - name: Install Universal ctags (Windows)
44d5760439SVladimir Kotal      if: runner.os == 'Windows'
45dcad061aSVladimir Kotal      run: choco install universal-ctags
46ff606017SVladimir Kotal    - name: Before build actions (Unix)
47d5760439SVladimir Kotal      if: runner.os == 'Linux' || runner.os == 'macOS'
48ff606017SVladimir Kotal      run: ./dev/before
49dcad061aSVladimir Kotal    - name: Maven build
50dcad061aSVladimir Kotal      shell: bash
51d5760439SVladimir Kotal      env:
52d5760439SVladimir Kotal        OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
53d5760439SVladimir Kotal        OPENGROK_REPO_SLUG: ${{ github.repository }}
54d5760439SVladimir Kotal        OPENGROK_REF: ${{ github.ref }}
55d5760439SVladimir Kotal        OPENGROK_COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
56d5760439SVladimir Kotal        OPENGROK_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
57d5760439SVladimir Kotal        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58d5760439SVladimir Kotal      run: ./dev/main
59