name: PullRequest builder TLA+
on: [pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v2
      with:
        # Number of commits to fetch. 0 indicates all history.
        # jgit task nested in customBuild.xml fails without history.
        fetch-depth: '0'
        
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11.0.3

      ##
      ## Run TLC tests.
      ##
    - name: Run TLC tests
      run: ant -f tlatools/org.lamport.tlatools/customBuild.xml -Dtest.halt=true compile compile-test test dist

      ##
      ## Trigger build of CommunityModule as integration tests.
      ##
    - uses: actions/checkout@v2
      with:
        repository: tlaplus/CommunityModules
        path: communitymodules/
        # Number of commits to fetch. 0 indicates all history.
        # jgit task nested in customBuild.xml fails without history.
        fetch-depth: '0'
    - name: Build CommunityModules
      run: |
          mkdir -p communitymodules/tlc
          cp tlatools/org.lamport.tlatools/dist/tla2tools.jar communitymodules/tlc/
          ant -f communitymodules/build.xml -Dskip.download=true   

      ##
      ## Trigger run of examples as integration tests.
      ##
    - uses: actions/checkout@v2
      with:
        repository: tlaplus/examples
        path: examples/
        # Number of commits to fetch. 0 indicates all history.
        # jgit task nested in customBuild.xml fails without history.
        fetch-depth: '0'
    - name: Run Examples
      run: |
          cp tlatools/org.lamport.tlatools/dist/tla2tools.jar examples/
          cd examples/
          bash .github/workflows/run.sh

Add PullRequest builder that runs all TLC tests, the CommunityModules, and most TLA+ examples.
Add PullRequest builder that runs all TLC tests, the CommunityModules,
and most TLA+ examples.

[Build]
