Skip to content

Commit

Permalink
Merge branch 'master' into tag_str
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh authored Jun 10, 2023
2 parents 8f34105 + 2c3c3c9 commit c20e090
Show file tree
Hide file tree
Showing 1,646 changed files with 85,634 additions and 83,356 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build-rti-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: Build RTI docker image
description: Build and install
runs:
using: "composite"
steps:
steps:
- run: .github/actions/build-rti-docker/build-rti-image.sh
shell: bash
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/build-rti-docker/build-rti-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
cd org.lflang/src/lib/c/reactor-c/core/federated/RTI
cd src/lib/c/reactor-c/core/federated/RTI
docker build -t rti:rti -f rti.Dockerfile ../../../
3 changes: 1 addition & 2 deletions .github/actions/install-rti/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Install RTI
description: Build and install
runs:
using: "composite"
steps:
steps:
- run: .github/actions/install-rti/install.sh
shell: bash

2 changes: 1 addition & 1 deletion .github/actions/install-rti/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
cd org.lflang/src/lib/c/reactor-c/core/federated/RTI
cd core/src/main/resources/lib/c/reactor-c/core/federated/RTI
mkdir build
cd build
if [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down
40 changes: 40 additions & 0 deletions .github/actions/setup-zephyr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Install Zephyr and dependencies (Linux only)
description: Install Zephyr and dependencies (Linux only)
runs:
using: "composite"
steps:
- name: Setup environment variables
run: |
echo "SDK_VERSION=0.16.1" >> $GITHUB_ENV
echo "ZEPHYR_VERSION=3.3.0" >> $GITHUB_ENV
shell: bash
- name: Dependencies
run: |
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
shell: bash
- name: Install West
run: pip install west
shell: bash
- name: Install Zephyr SDK
run : |
wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{env.SDK_VERSION}}/zephyr-sdk-${{env.SDK_VERSION}}_linux-x86_64.tar.xz"
wget -O - "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{env.SDK_VERSION}}/sha256.sum" | shasum --check --ignore-missing
sudo tar xvf "zephyr-sdk-${{env.SDK_VERSION}}_linux-x86_64.tar.xz" --directory /opt/
cd "/opt/zephyr-sdk-${{env.SDK_VERSION}}"
sudo ./setup.sh -t all -h -c
shell: bash
- name: Download and install Zephyr RTOS
run: |
cd $HOME
west init zephyrproject --mr "v${{env.ZEPHYR_VERSION}}"
cd zephyrproject
west update
west zephyr-export
pip install -r zephyr/scripts/requirements.txt
echo "ZEPHYR_BASE=$HOME/zephyrproject/zephyr" >> $GITHUB_ENV
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${{env.SDK_VERSION}}/" >> $GITHUB_ENV
shell: bash
9 changes: 9 additions & 0 deletions .github/scripts/check-diff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
changes() {
git diff --name-only HEAD $(git merge-base HEAD origin/master)
}

if changes | grep -q $1; then
echo "CHANGED_$2=1" >> $GITHUB_OUTPUT
else
echo "CHANGED_$2=0" >> $GITHUB_OUTPUT
fi
40 changes: 0 additions & 40 deletions .github/scripts/package-cli.sh

This file was deleted.

25 changes: 0 additions & 25 deletions .github/scripts/test-build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/test-lfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd $GITHUB_WORKSPACE
function test_with_links() {
rm -rf foo
mkdir -p foo/bar/baz
ln -s ../bin/${1} foo/link-foo
ln -s ../bin/${1} foo/link-foo
ln -s ../link-foo foo/bar/link-bar
ln -s ../link-bar foo/bar/baz/link-${1}
foo/bar/baz/link-${1} --help
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/test-lff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd $GITHUB_WORKSPACE
function test_with_links() {
rm -rf foo
mkdir -p foo/bar/baz
ln -s ../bin/${1} foo/link-foo
ln -s ../bin/${1} foo/link-foo
ln -s ../link-foo foo/bar/link-bar
ln -s ../link-bar foo/bar/baz/link-${1}
foo/bar/baz/link-${1} --help
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The [benchmark-tests.yml](https://github.com/lf-lang/lingua-franca/blob/master/.
### 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).
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
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/all-misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Non-target-specific tests
name: CI (misc)

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [synchronize, opened, reopened, ready_for_review, converted_to_draft]
merge_group:

env:
# 2020.11
vcpkgGitRef: 0bf3923f9fab4001c00f0f429682a0853b5749e0

concurrency:
group: all-non-target-specific-${{ github.ref }}-${{ github.event_path }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
check-diff:
uses: ./.github/workflows/check-diff.yml

# Test the Gradle build.
building:
uses: ./.github/workflows/build.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}

# Build the tools used for processing execution traces
tracing:
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-tracing == 1 }}
uses: ./.github/workflows/build-trace-tools.yml
needs: check-diff
with:
all-platforms: ${{ !github.event.pull_request.draft }}

# Run tests for the standalone compiler.
cli:
if: ${{ !github.event.pull_request.draft }}
uses: ./.github/workflows/cli-tests.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}

# Run language server tests.
lsp:
if: ${{ !github.event.pull_request.draft }}
uses: ./.github/workflows/lsp-tests.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}
53 changes: 53 additions & 0 deletions .github/workflows/all-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Target-specific tests
name: CI (by target)

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [synchronize, opened, reopened, ready_for_review, converted_to_draft]
merge_group:

env:
# 2020.11
vcpkgGitRef: 0bf3923f9fab4001c00f0f429682a0853b5749e0

concurrency:
group: all-targets-${{ github.ref }}-${{ github.event_path }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
check-diff:
uses: ./.github/workflows/check-diff.yml

c:
uses: ./.github/workflows/only-c.yml
needs: check-diff
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-c == 1 }}

cpp:
uses: ./.github/workflows/only-cpp.yml
needs: check-diff
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-cpp == 1 }}

py:
uses: ./.github/workflows/only-py.yml
needs: check-diff
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-py == 1 }}

rs:
uses: ./.github/workflows/only-rs.yml
needs: check-diff
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-rs == 1 }}

ts:
uses: ./.github/workflows/only-ts.yml
needs: check-diff
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-ts == 1 }}

serialization:
if: ${{ !github.event.pull_request.draft || needs.check-diff.outputs.changed-c == 1 || needs.check-diff.outputs.changed-py == 1 || needs.check-diff.outputs.changed-ts == 1 }}
needs: check-diff
uses: ./.github/workflows/serialization-tests.yml
11 changes: 8 additions & 3 deletions .github/workflows/build-trace-tools.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Build the tools for processing execution traces
name: Build trace tools

on:
workflow_call:
inputs:
all-platforms:
required: false
default: true
type: boolean

jobs:
run:
build-trace-tools:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]')) || fromJSON('["ubuntu-latest"]') }}
runs-on: ${{ matrix.platform }}
steps:
- name: Check out lingua-franca repository
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ on:
required: false
type: boolean
default: false
all-platforms:
required: false
default: false
type: boolean
secrets:
envPAT:
required: false
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
build-toolchain:
strategy:
matrix:
platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]')) || fromJSON('["ubuntu-latest"]') }}
runs-on: ${{ matrix.platform }}
steps:
- name: Check out lingua-franca repository
uses: actions/checkout@v3
Expand All @@ -24,11 +31,11 @@ jobs:
- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Build and package lf cli tools (nightly build)
run: .github/scripts/package-cli.sh nightly
run: ./gradlew build -Pnightly
shell: bash
if: ${{ inputs.nightly == true }}
- name: Build and package lf cli tools (regular build)
run: .github/scripts/package-cli.sh
run: ./gradlew build
shell: bash
if: ${{ inputs.nightly != true }}
- name: Deploy nightly release
Expand All @@ -39,5 +46,14 @@ jobs:
prerelease: true
title: "Lingua Franca Nightly"
files: |
build_upload/*
build/distributions/*
if: ${{ inputs.nightly == true }}
- name: Collect code coverage
run: ./gradlew jacocoTestReport
if: ${{ runner.os == 'Linux' }}
- name: Report to CodeCov
uses: codecov/[email protected]
with:
files: core/build/reports/xml/jacoco,cli/lfc/build/reports/xml/jacoco,cli/lff/build/reports/xml/jacoco
fail_ci_if_error: false
verbose: true
Loading

0 comments on commit c20e090

Please sign in to comment.