hamzaremmal/amy

View on GitHub
.github/workflows/amyc.yml

Summary

Maintainability
Test Coverage
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: build

on: [push, pull_request]

permissions:
  contents: read

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up JDK 11
      uses: actions/setup-java@v4
      with:
        java-version: '11'
        distribution: 'temurin'
        cache: 'sbt'
    - name: Set up Node JS
      uses: actions/setup-node@v4
    - name: Install deasync
      run: npm install deasync
    - name: Install wat2wasm
      run: sudo apt install wabt
    - name: Run the compiler's test
      run: sbt amy-compiler/test
    - name: Run the interpreter's test
      run: sbt amy-interpreter/test
  test-coverage:
    needs: build
    if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK 11
        uses: actions/setup-java@v4
        with:
          java-version: '11'
          distribution: 'temurin'
          cache: 'sbt'
      - name: Set up Node JS
        uses: actions/setup-node@v4
      - name: Install deasync
        run: npm install deasync
      - name: Install wat2wasm
        run: sudo apt install wabt
      - name : Prepare Code Climate
        run : |
          curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
          chmod +x ./cc-test-reporter
          ./cc-test-reporter before-build
      - name : Generate Coverage Report
        run: sbt jacocoAggregate
      - name : Report to Code Climate
        run : |
          ./cc-test-reporter format-coverage ${{ github.workspace }}/target/scala-3.3.0/jacoco/report/aggregate/jacoco.xml --input-type jacoco
          ./cc-test-reporter upload-coverage
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
          JACOCO_SOURCE_PATH: "${{ github.workspace }}/compiler/src/main/scala ${{ github.workspace }}/interpreter/src/main/scala"