name: Build and Test

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    env:
      CXX: clang++-9
      CLANG_FORMAT: clang-format-9

    steps:
    - uses: actions/checkout@v2.2.0
    - name: install ninja
      run: |
        mkdir -p ${GITHUB_WORKSPACE}/ninja-bin; cd ${GITHUB_WORKSPACE}/ninja-bin
        wget https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip
        unzip ninja-linux.zip
        rm ninja-linux.zip
        echo "${GITHUB_WORKSPACE}/ninja-bin" >> "$GITHUB_PATH"
    - name: make
      run: make -j4 ckati ckati_tests
    - name: clang format
      run: ./clang-format-check
    - name: run standalone tests
      run: go test --ckati
    - name: run ninja tests
      run: go test --ckati --ninja
    - name: run ninja all targets tests
      run: go test --ckati --ninja --all
    - name: run ninja unit tests
      run: ./ninja_test
    - name: run stringpiece unit tests
      run: ./string_piece_test
    - name: run strutil unit tests
      run: ./strutil_test
    - name: run find unit tests
      run: ./find_test
    - name: run JSON dump tests
      run: testcase/dump/run.sh

name: Build and Test

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    env:
      CXX: clang++-12
      CLANG_FORMAT: clang-format-12

    steps:
    - uses: actions/checkout@v2
    - name: install ninja
      run: |
        mkdir -p ${GITHUB_WORKSPACE}/ninja-bin; cd ${GITHUB_WORKSPACE}/ninja-bin
        wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
        unzip ninja-linux.zip
        rm ninja-linux.zip
        echo "${GITHUB_WORKSPACE}/ninja-bin" >> "$GITHUB_PATH"
    - name: make
      run: make -j4 ckati ckati_tests
    - name: clang format
      run: ./clang-format-check
    - name: run standalone tests
      run: go test --ckati
    - name: run ninja tests
      run: go test --ckati --ninja
    - name: run ninja all targets tests
      run: go test --ckati --ninja --all
    - name: run ninja unit tests
      run: ./ninja_test
    - name: run stringpiece unit tests
      run: ./string_piece_test
    - name: run strutil unit tests
      run: ./strutil_test
    - name: run find unit tests
      run: ./find_test
    - name: run JSON dump tests
      run: testcase/dump/run.sh

Update github actions to accommodate recent changes
Update github actions to accommodate recent changes

This addresses:
  - update actions version to use the latest v2
  - clang-9 is gone from ubuntu-latest, hence jump to the latest
    available, i.e. clang-12 as of now.
  - update Ninja to use the latest release, use a marketplace action
    instead

Signed-off-by: Matthias Maennich <9bce818340fa3fdb97f10fe3386d272c8064360e@google.com>
