diff --git a/.github/workflows/README.md b/.github/workflows/README.md index f88a535ce9..d11093c691 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -44,3 +44,9 @@ If a repository has a text file that stores a ref (e.g., a SHA1 hash of a commit After workflow execution, the value of the output `ref` will be equal to the first line in the given `file`. ## Nightly Build See [nightly-build.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/nightly-build.yml). + +## Debugging tests + +To debug test failures that are difficult to reproduce locally, it can be useful +to add a step such as [this one](https://github.com/marketplace/actions/debugging-with-ssh) to SSH into the GitHub Actions runner. Such a debugging step +should not be included in the `master` version of the workflow file. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f339b9aa9e..ab27e91ac1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,11 @@ jobs: uses: lf-lang/lingua-franca/.github/workflows/build.yml@master needs: cancel + # Check that automatic code formatting works. + format: + uses: lf-lang/lingua-franca/.github/workflows/format.yml@master + needs: cancel + # Run the unit tests. unit-tests: uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master diff --git a/.github/workflows/cpp-ros2-tests.yml b/.github/workflows/cpp-ros2-tests.yml index 7bd4414e11..04adebf0b7 100644 --- a/.github/workflows/cpp-ros2-tests.yml +++ b/.github/workflows/cpp-ros2-tests.yml @@ -30,12 +30,12 @@ jobs: ref: ${{ inputs.runtime-ref }} if: ${{ inputs.runtime-ref }} - name: Setup ROS2 - uses: ros-tooling/setup-ros@0.2.2 + uses: ros-tooling/setup-ros@v0.4 with: - required-ros-distributions: galactic + required-ros-distributions: rolling - name: Run C++ tests; run: | - source /opt/ros/galactic/setup.bash + source /opt/ros/*/setup.bash ./gradlew test --tests org.lflang.tests.runtime.CppRos2Test.* - name: Report to CodeCov uses: codecov/codecov-action@v2.1.0 diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index 667ffc3f3f..77b1049925 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -28,10 +28,11 @@ jobs: - name: Install Dependencies OS X run: brew install coreutils if: runner.os == 'macOS' - - name: Install clang-tidy on Ubuntu + - name: Install clang-tidy and lcov on Ubuntu run: | sudo apt-get update sudo apt-get install -y clang-tidy + sudo apt-get install -y lcov if: matrix.platform == 'ubuntu-latest' - name: Check out specific ref of reactor-cpp uses: actions/checkout@v2 @@ -43,10 +44,29 @@ jobs: - name: Run C++ tests; run: | ./gradlew test --tests org.lflang.tests.runtime.CppTest.* - - name: Report to CodeCov + - name: Report Java coverage to CodeCov uses: codecov/codecov-action@v2.1.0 with: file: org.lflang.tests/build/reports/xml/jacoco fail_ci_if_error: false verbose: true if: ${{ !inputs.runtime-ref }} # i.e., if this is part of the main repo's CI + - name: Collect reactor-cpp coverage data + run: | + lcov --capture --directory test/Cpp --output-file coverage.info + lcov --extract coverage.info ${GITHUB_WORKSPACE}/test/Cpp/src-gen/reactor-cpp-default/\* --output-file reactor-cpp.info + genhtml reactor-cpp.info --output-directory reactor-cpp.coverage + if: matrix.platform == 'ubuntu-latest' + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: reactor-cpp.coverage + path: reactor-cpp.coverage + if: matrix.platform == 'ubuntu-latest' + - name: Report C++ coverage to CodeCov + uses: codecov/codecov-action@v2.1.0 + with: + file: reactor-cpp.info + fail_ci_if_error: false + verbose: true + if: matrix.platform == 'ubuntu-latest' diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000000..ce68d1c830 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,19 @@ +name: Test the automatic code formatting task + +on: + workflow_call: + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Check out lingua-franca repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + - name: Prepare build environment + uses: ./.github/actions/prepare-build-env + - name: Run spotlessCheck + run: ./gradlew spotlessCheck + shell: bash diff --git a/.github/workflows/lsp-tests.yml b/.github/workflows/lsp-tests.yml index ba048dea77..183db879f7 100644 --- a/.github/workflows/lsp-tests.yml +++ b/.github/workflows/lsp-tests.yml @@ -59,6 +59,10 @@ jobs: brew install protobuf brew install protobuf-c if: ${{ runner.os == 'macOS' }} + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Run language server Python tests without PyLint run: ./gradlew test --tests org.lflang.tests.lsp.LspTests.pythonValidationTestSyntaxOnly - name: Report to CodeCov @@ -69,6 +73,10 @@ jobs: verbose: true - name: Install pylint run: python3 -m pip install pylint + if: ${{ runner.os != 'macOS' }} + - name: Install pylint macOS + run: brew install pylint + if: ${{ runner.os == 'macOS' }} - name: Run language server tests run: ./gradlew clean test --tests org.lflang.tests.lsp.LspTests.*ValidationTest - name: Report to CodeCov diff --git a/.github/workflows/py-tests.yml b/.github/workflows/py-tests.yml index 66ba232393..7102b9f542 100644 --- a/.github/workflows/py-tests.yml +++ b/.github/workflows/py-tests.yml @@ -30,8 +30,9 @@ jobs: - name: Prepare build environment uses: ./.github/actions/prepare-build-env - name: Setup Python - uses: actions/setup-python@v2 - if: ${{ runner.os == 'Windows' }} + uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Install dependencies OS X run: | brew install coreutils diff --git a/.github/workflows/serialization-tests.yml b/.github/workflows/serialization-tests.yml index 55ca7271ee..88a3ab5ff3 100644 --- a/.github/workflows/serialization-tests.yml +++ b/.github/workflows/serialization-tests.yml @@ -21,13 +21,13 @@ jobs: - name: Prepare build environment uses: ./.github/actions/prepare-build-env - name: Setup ROS2 - uses: ros-tooling/setup-ros@0.2.2 + uses: ros-tooling/setup-ros@v0.4 with: required-ros-distributions: rolling - name: Install Protobuf Ubuntu run: | sudo apt-get update - sudo apt-get install -y libprotobuf-c-dev protobuf-c-compiler protobuf-compiler libprotobuf-dev + sudo apt-get install -y libprotobuf-c-dev protobuf-c-compiler protobuf-compiler libprotobuf-dev python3-protobuf - name: Install LinguaFrancaBase run: pip3 install LinguaFrancaBase - name: Run serialization tests; diff --git a/.github/workflows/ts-tests.yml b/.github/workflows/ts-tests.yml index ddb1848093..de2b2be406 100644 --- a/.github/workflows/ts-tests.yml +++ b/.github/workflows/ts-tests.yml @@ -7,7 +7,7 @@ jobs: run: strategy: matrix: - platform: [ubuntu-latest, macos-latest, windows] + platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: Check out lingua-franca repository diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index d88bdba9cd..86a223888d 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -54,8 +54,6 @@ @@ -367,4 +365,4 @@