name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{matrix.os}}
    strategy:
      matrix:
        os: ["ubuntu-20.04", "macos-latest", "windows-latest"]

    steps:
    - uses: actions/checkout@v1
    - uses: olafurpg/setup-scala@v5
      with:
        java-version: 11
    - name: Mount caches
      uses: actions/cache@v2
      with:
        path: |
          ~/.sbt
          ~/.ivy2/cache
          ~/.cache/coursier
        key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
    - name: Install tools for Native
      if: ${{runner.os != 'Windows' }}
      run: |
        ./ci_setup.sh
    - name: Remove native tests (Windows only)
      if: ${{ runner.os == 'Windows' }}
      run: |
        rm -rf examples/scalapb-crossproject
      shell: bash
    - name: Compile and test
      run: |
       sbt ^test ^scripted
       cd examples
       for d in */ ; do cd "$d" && sbt test && cd ../ ; done
      shell: bash
    - name: Format check
      if: ${{ runner.os == 'Linux' }}
      run: |
        sbt scalafmtCheck test:scalafmtCheck scalafmtSbtCheck ^test ^scripted

name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{matrix.os}}
    strategy:
      matrix:
        os: ["ubuntu-20.04", "macos-latest", "windows-latest"]

    steps:
    - uses: actions/checkout@v1
    - uses: olafurpg/setup-scala@v5
      with:
        java-version: 11
    - name: Mount caches
      uses: actions/cache@v2
      with:
        path: |
          ~/.sbt
          ~/.ivy2/cache
          ~/.cache/coursier
        key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
    - name: Install tools for Native
      if: ${{runner.os != 'Windows' }}
      run: |
        ./ci_setup.sh
    - name: Remove native tests (Windows only)
      if: ${{ runner.os == 'Windows' }}
      run: |
        rm -rf examples/scalapb-crossproject
      shell: bash
    - name: Compile and test
      run: |
       sbt ^test ^scripted
       cd examples
       for d in */ ; do cd "$d" && sbt test && cd ../ ; done
      shell: bash
    - name: Format check
      if: ${{ runner.os == 'Linux' }}
      run: |
        sbt scalafmtCheck test:scalafmtCheck scalafmtSbtCheck

Remove duplicate test run for linux
Remove duplicate test run for linux
