Skip to content

Commit

Permalink
Merge branch 'master' into static-schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
lsk567 committed Sep 25, 2023
2 parents b3d0600 + c623210 commit cd71f4b
Show file tree
Hide file tree
Showing 597 changed files with 4,248 additions and 1,535 deletions.
38 changes: 38 additions & 0 deletions .github/actions/latest-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Latest release
description: Report the latest release of the current repo
outputs:
ref:
value: ${{ steps.find.outputs.ref }}
description: The latest semver tag
ver:
value: ${{ steps.find.outputs.ver }}
description: The semver corresponding to the latest semver tag

runs:
using: "composite"
steps:
- name: Install semver-tool
run: |
wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
chmod +x /usr/local/bin/semver
semver --version
shell: bash
- name: Fetch all tags
run: git fetch --all --tags
shell: bash
- name: Fetch latest-release script
run: |
wget https://raw.githubusercontent.com/lf-lang/lingua-franca/master/.github/scripts/latest-release.sh
chmod +x latest-release.sh
shell: bash
- name: Find the latest release
id: find
run: |
export tag=$(./latest-release.sh)
echo "ref=${tag}" >> $GITHUB_OUTPUT
shopt -s extglob
export ver="${tag##v}"
echo "ver=${ver}" >> $GITHUB_OUTPUT
echo "Latest release tag: ${tag}"
echo "Without a leading 'v': ${ver}"
shell: bash
45 changes: 8 additions & 37 deletions .github/actions/prepare-build-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,13 @@
name: Prepare build environment (Linux only)
description: Set up Java, Maven, Gradle, etc.
name: Set up build environment
description: Set up Java and Gradle (including caching).
runs:
using: "composite"
steps:
- name: Set up Java 17
run: |
echo "$JAVA_HOME_17_X64/bin" >> $GITHUB_PATH
echo "org.gradle.java.home=${JAVA_HOME_17_X64//\\/\/}" >> gradle.properties
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
shell: bash
- name: Check settings
run: |
echo $(which java)
cat gradle.properties
echo $JAVA_HOME
shell: bash
- name: Create hash of Gradle configuration (macOS only)
run: |
echo "gradle-hash"="$(find . -type f \( -name "gradle.properties" -o -name "gradle-wrapper.properties" \) -exec cat {} + | shasum -a 256 | cut -d ' ' -f 1)" >> $GITHUB_ENV
if: ${{ runner.os == 'macOS' }}
shell: bash
- name: Create hash of Gradle configuration (Linux and Windows only)
run: |
echo "gradle-hash"="$(find . -type f \( -name "gradle.properties" -o -name "gradle-wrapper.properties" \) -exec cat {} + | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_ENV
if: ${{ runner.os == 'Windows' || runner.os == 'Linux' }}
shell: bash
- name: Cache
uses: actions/cache@v3
- uses: actions/setup-java@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ env.gradle-hash }}
# restore-keys: |
# ${{ runner.os }}-gradle-
- name: Bring down Gradle daemon (Windows)
uses: webiny/[email protected]
id: post-run-command
distribution: temurin
java-version: 17
- name: Gradle Build Action
uses: gradle/[email protected]
with:
run: ./gradlew --stop
if: ${{ runner.os == 'Windows' }}
cache-read-only: false
34 changes: 34 additions & 0 deletions .github/actions/setup-francabot/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Load global configuration settings for francabot
description: Set up author information and GPG signature
author: Marten Lohstroh <[email protected]>

inputs:
gpg-key:
description: 'francabot GPG key'
required: true
gpg-passphrase:
description: 'francabot GPG passphrase'
required: true

runs:
using: composite
steps:
- name: Set environment variables
run: |
echo "username=lingua-franca[bot]" >> "$GITHUB_ENV"
echo "[email protected]" >> "$GITHUB_ENV"
echo "user-and-email=lingua-franca[bot] <[email protected]>" >> "$GITHUB_ENV"
shell: bash
- name: Configure git username and email
run: |
git config --global user.name '${{ env.username }}'
git config --global user.email '${{ env.email }}'
shell: bash
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ inputs.gpg-key }}
passphrase: ${{ inputs.gpg-passphrase }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
2 changes: 1 addition & 1 deletion .github/actions/setup-zephyr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
- name: Setup environment variables
run: |
echo "SDK_VERSION=0.16.1" >> $GITHUB_ENV
echo "ZEPHYR_VERSION=3.3.0" >> $GITHUB_ENV
echo "ZEPHYR_VERSION=3.4.0" >> $GITHUB_ENV
shell: bash
- name: Dependencies
run: |
Expand Down
11 changes: 8 additions & 3 deletions .github/scripts/test-lfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ function test_with_links() {
foo/bar/baz/link-${1} --help
}

bin/lfc test/C/src/Minimal.lf
bin/lfc-dev test/C/src/Minimal.lf

# Ensure that lfc is robust to symbolic links.
test_with_links "lfc"
# Ensure that lfc can be invoked via symbolic links.
test_with_links "lfc-dev"

# Ensure that lfc can be invoked from outside the root directory.
cd bin
./lfc-dev --help
cd ..
11 changes: 8 additions & 3 deletions .github/scripts/test-lfd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ function test_with_links() {
foo/bar/baz/link-${1} --help
}

bin/lfd test/C/src/Minimal.lf
bin/lfd-dev test/C/src/Minimal.lf

# Ensure that lfd is robust to symbolic links.
test_with_links "lfd"
# Ensure that lfd can be invoked via symbolic links.
test_with_links "lfd-dev"

# Ensure that lfd can be invoked from outside the root directory.
cd bin
./lfd-dev --help
cd ..
21 changes: 13 additions & 8 deletions .github/scripts/test-lff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ function test_with_links() {
}

# just a couple of smoke tests
bin/lff --help
bin/lff --version
bin/lff-dev --help
bin/lff-dev --version

bin/lff -d test/C/src/Minimal.lf
bin/lff --dry-run test/Cpp/src/Minimal.lf
bin/lff-dev -d test/C/src/Minimal.lf
bin/lff-dev --dry-run test/Cpp/src/Minimal.lf

bin/lff -d test/C/src/Minimal.lf
bin/lff --dry-run test/Cpp/src/Minimal.lf
bin/lff-dev -d test/C/src/Minimal.lf
bin/lff-dev --dry-run test/Cpp/src/Minimal.lf

# Ensure that lff is robust to symbolic links.
test_with_links "lff"
# Ensure that lff can be invoked via symbolic links.
test_with_links "lff-dev"

# Ensure that lfc can be invoked from outside the root directory.
cd bin
./lff-dev --help
cd ..
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ jobs:
uses: ./.github/actions/report-code-coverage
with:
files: core/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml,cli/base/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml,cli/lfc/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml,cli/lfd/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml,cli/lff/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml

epoch:
uses: lf-lang/epoch/.github/workflows/build.yml@main
with:
lingua-franca-ref: ${{ github.head_ref || github.ref_name }}
lingua-franca-repo: ${{ github.event.pull_request.head.repo.full_name }}
upload-artifacts: false
8 changes: 7 additions & 1 deletion .github/workflows/c-zephyr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
if: ${{ inputs.runtime-ref }}
- name: Run Zephyr smoke tests
run: |
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildZephyr* core:integrationTestCodeCoverageReport
./gradlew core:integrationTest \
--tests org.lflang.tests.runtime.CZephyrTest.buildZephyrUnthreaded* \
--tests org.lflang.tests.runtime.CZephyrTest.buildZephyrThreaded* core:integrationTestCodeCoverageReport
./.github/scripts/run-zephyr-tests.sh test/C/src-gen
rm -r test/C/src-gen
- name: Run basic tests
Expand All @@ -54,6 +56,10 @@ jobs:
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildConcurrent* core:integrationTestCodeCoverageReport
./.github/scripts/run-zephyr-tests.sh test/C/src-gen
rm -r test/C/src-gen
- name: Run Zephyr board tests
run: |
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildZephyrBoards* core:integrationTestCodeCoverageReport
rm -r test/C/src-gen
- name: Report to CodeCov
uses: ./.github/actions/report-code-coverage
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cli-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ jobs:
if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }}
- name: Test lfc PowerShell script (Windows only)
run: |
bin/lfc.ps1 --version
bin/lfc.ps1 test/C/src/Minimal.lf
bin/lfc-dev.ps1 --version
bin/lfc-dev.ps1 test/C/src/Minimal.lf
./gradlew assemble
./build/install/lf-cli/bin/lfc.bat --version
./build/install/lf-cli/bin/lfc.bat test/C/src/Minimal.lf
if: ${{ runner.os == 'Windows' }}
- name: Test lff PowerShell script (Windows only)
run: |
bin/lff.ps1 --version
bin/lff.ps1 test/C/src/Minimal.lf
bin/lff-dev.ps1 --version
bin/lff-dev.ps1 test/C/src/Minimal.lf
./gradlew assemble
./build/install/lf-cli/bin/lff.bat --version
./build/install/lf-cli/bin/lff.bat test/C/src/Minimal.lf
if: ${{ runner.os == 'Windows' }}
- name: Test lfd PowerShell script (Windows only)
run: |
bin/lfd.ps1 --version
bin/lfd.ps1 test/C/src/Minimal.lf
bin/lfd-dev.ps1 --version
bin/lfd-dev.ps1 test/C/src/Minimal.lf
./gradlew assemble
./build/install/lf-cli/bin/lfd.bat --version
./build/install/lf-cli/bin/lfd.bat test/C/src/Minimal.lf
Expand Down
50 changes: 22 additions & 28 deletions .github/workflows/latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,43 @@ name: Latest release
on:
workflow_call:
inputs:
owner:
type: string
description: Owner of the repo
default: lf-lang
repo:
type: string
description: Repo to find the latest release of
default: lingua-franca
outputs:
ref:
description: "The tag of the latest release"
value: ${{ jobs.run.outputs.ref }}
value: ${{ jobs.get-latest-release.outputs.ref }}
ver:
description: "The semver of the latest release (without a leading 'v')"
value: ${{ jobs.run.outputs.ver }}
# Also allow trigging the workflow manually.
value: ${{ jobs.get-latest-release.outputs.ver }}

workflow_dispatch:
inputs:
owner:
type: string
description: Owner of the repo
default: lf-lang
repo:
type: string
description: Repo to find the latest release of
default: lingua-franca

jobs:
get-latest-release:
runs-on: ubuntu-latest
outputs:
ref: ${{ steps.find.outputs.ref }}
ver: ${{ steps.find.outputs.ver }}
ref: ${{ steps.semver.outputs.ref }}
ver: ${{ steps.semver.outputs.ver }}
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: lf-lang/${{ inputs.repo }}
- name: Install semver-tool
run: |
wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
chmod +x /usr/local/bin/semver
semver --version
- name: Fetch all tags
run: git fetch --all --tags
- name: Fetch latest-release script
run: |
wget https://raw.githubusercontent.com/lf-lang/lingua-franca/master/.github/scripts/latest-release.sh
chmod +x latest-release.sh
- name: Find the latest release
id: find
run: |
export tag=$(./latest-release.sh)
echo "{ref}={${tag}}" >> $GITHUB_OUTPUT
shopt -s extglob
export ver="${tag##v}"
echo "{ver}={${ver}}" >> $GITHUB_OUTPUT
echo "Latest release tag: ${tag}"
echo "Without a leading 'v': ${ver}"
repository: ${{ github.event.inputs.owner || inputs.owner }}/${{ github.event.inputs.repo || inputs.repo }}
- id: semver
uses: lf-lang/lingua-franca/.github/actions/latest-release@master
Loading

0 comments on commit cd71f4b

Please sign in to comment.