Skip to content

Commit

Permalink
Merge branch 'master' into rust-more-benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnrd committed Jan 18, 2022
2 parents 6912526 + 957ce10 commit c3aba53
Show file tree
Hide file tree
Showing 210 changed files with 11,119 additions and 5,381 deletions.
7 changes: 7 additions & 0 deletions .github/actions/build-rti-docker/action.yml
@@ -0,0 +1,7 @@
name: Build RTI docker image
description: Build and install
runs:
using: "composite"
steps:
- run: .github/actions/build-rti-docker/build-rti-image.sh
shell: bash
3 changes: 3 additions & 0 deletions .github/actions/build-rti-docker/build-rti-image.sh
@@ -0,0 +1,3 @@
#!/bin/bash
cd org.lflang/src/lib/c/reactor-c/core/federated/RTI
docker build -t rti:rti -f rti.Dockerfile ../../../core/
1 change: 0 additions & 1 deletion .github/actions/build-setup/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions .github/actions/build-setup/action.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .github/actions/install-rti/action.yml
@@ -0,0 +1,8 @@
name: Install RTI
description: Build and install
runs:
using: "composite"
steps:
- run: .github/actions/install-rti/install.sh
shell: bash

7 changes: 7 additions & 0 deletions .github/actions/install-rti/install.sh
@@ -0,0 +1,7 @@
#!/bin/bash
cd org.lflang/src/lib/c/reactor-c/core/federated/RTI
mkdir build
cd build
cmake ../
make
sudo make install
9 changes: 9 additions & 0 deletions .github/scripts/latest-release.sh
@@ -0,0 +1,9 @@
#!/bin/bash
latest="0.0.0"
while IFS= read -r line; do
if [[ $(semver compare ${line} ${latest} 2> /dev/null) = '1' ]]; then
latest=${line}
fi
#echo "... $line ..."
done <<< "$(git tag)"
echo $latest
3 changes: 1 addition & 2 deletions .github/scripts/package_lfc.sh
Expand Up @@ -25,6 +25,5 @@ cp bin/lfc.ps1 "${outname}/bin/lfc.ps1"

# zip/tar everything - the files will be put into the build_upload directory
mkdir -p build_upload
zip -r "build_upload/${outname}.zip" "${outname}"
zip --symlinks -r "build_upload/${outname}.zip" "${outname}"
tar cvf "build_upload/${outname}.tar.gz" "${outname}"

46 changes: 46 additions & 0 deletions .github/workflows/README.md
@@ -0,0 +1,46 @@
# Lingua Franca workflows

## Continuous Integration
The main CI configuration can be found in [ci.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/ci.yml) and gets triggered by pushes to `master` and by pushes to branches involved in an open pull request.

**NOTE: [ci.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/ci.yml) references these workflows with respect to master (signified by the "@master" suffix). If you edit a workflow and want your changes reflected in the CI run for your pull request, then make sure that the workflow of your feature branch gets invoked instead of the one on master (and change back to "@master" before merging so that the feature branch can be safely deleted).**

### Benchmark tests
The [benchmark-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/lfc-tests.yml) workflow compiles and runs benchmarks for a given target. The purpose of this workflow is not to gather performance results but to ensure that the benchmark programs remain functional. This workflow has one (optional) argument:
- `target` to specify the target to run benchmark test for (defaults to `Cpp`).

### CLI tests
The [lfc-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/lfc-tests.yml) workflow tests command line access to the Lingua Franca compiler via `lfc`.
### Target-specific tests
Each target has its own [reusable workflow](https://docs.github.com/en/actions/learn-github-actions/reusing-workflows).
#### C/CCpp ([c-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/c-tests.yml))
This workflow has the following (optional) arguments:
- `compiler-ref` to specify which ref of the `lingua-franca` repository to check out; and
- `runtime-ref` to specify which ref of the `reactor-c` submodule to check out.

#### C++ ([cpp-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/cpp-tests.yml))

#### Python ([py-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/py-tests.yml))
This workflow has the following (optional) arguments:
- `compiler-ref` to specify which ref of the `lingua-franca` repository to check out;
- `reactor-c-ref` to specify which ref of the `reactor-c` submodule to check out; and
- `reactor-c-py-ref` to specify which ref of the `reactor-c-py` submodule to check out.

#### Rust ([rs-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/rs-tests.yml))

#### TypeScript ([ts-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/ts-tests.yml))
This workflow has the following (optional) arguments:
- `compiler-ref` to specify which ref of the `lingua-franca` repository to check out; and
- `runtime-ref` to specify which ref of the `reactor-ts` submodule to check out.

### Unit tests
Several parts of the compiler are probed using unit tests. These tests are carried out using the [unit-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/unit-tests.yml) workflow. This workflow also collects code coverage statistics based on these unit tests _as well as_ the joint coverage achieved by the target-specific integration tests. It does this using an [extra JUnit test](https://github.com/lf-lang/lingua-franca/blob/master/org.lflang.tests/src/org/lflang/tests/compiler/CodeGenCoverage.java) that carries out a lighter version of all the integration tests (skipping the target compilation and program execution parts, which do not involve much of our own compiler code).

### Utilities
Satellite repositories that make use of Lingua Franca may want to reuse workflows that are of general utility.
#### Extract a ref from a file ([extract-ref.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/extract-ref.yml))
If a repository has a text file that stores a ref (e.g., a SHA1 hash of a commit) and its contents must be used as a variable in a workflow, then [extract-ref.yml](https://github.com/lf-lang/lingua-franca/blob/master/.github/workflows/extract-ref.yml) can be used to accomplish this. This workflow takes a single (required) parameter:
- `file`: a string that specifies the path to the text file that has the ref.
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).
44 changes: 44 additions & 0 deletions .github/workflows/benchmark-tests.yml
@@ -0,0 +1,44 @@
name: Benchmark tests

on:
workflow_call:
inputs:
target:
required: false
type: string
default: Cpp

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 14
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Python dependencies
run: pip3 install -r benchmark/runner/requirements.txt
- name: Build lfc
run: |
./gradlew buildLfc
- name: Setup C++ build environment
run: |
./bin/lfc test/Cpp/src/Minimal.lf
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/test/Cpp/lib" >> $GITHUB_ENV
if: ${{ inputs.target == 'Cpp' }}
- name: Set LF_PATH environmental variable
run: |
echo "LF_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Test C benchmarks
run: |
python3 benchmark/runner/run_benchmark.py -m test_mode=True iterations=1 benchmark="glob(*)" target=lf-c,lf-c-unthreaded iterations=1
if: ${{ inputs.target == 'C' }}
- name: Test C++ benchmarks
run: |
python3 benchmark/runner/run_benchmark.py -m test_mode=True iterations=1 benchmark="glob(*)" target=lf-cpp iterations=1 target.params.extra_args="[--external-runtime-path, ${GITHUB_WORKSPACE}/test/Cpp]"
if: ${{ inputs.target == 'Cpp' }}

0 comments on commit c3aba53

Please sign in to comment.