Skip to content

Commit

Permalink
Merge pull request #55 from lf-lang/check-versions
Browse files Browse the repository at this point in the history
Dependency checks and environment setup assistance
  • Loading branch information
petervdonovan authored Jul 22, 2022
2 parents b027e8f + 8294e4a commit 0de30fc
Show file tree
Hide file tree
Showing 24 changed files with 4,917 additions and 11,392 deletions.
16 changes: 16 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build
description: Set up repository and install dependencies required to build extension.

runs:
using: "composite"
steps:
- name: Check out vscode-lingua-franca repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 1
- name: Prepare LF build environment
uses: ./lingua-franca/.github/actions/prepare-build-env
- name: Build the VS Code extension
run: npm install --ignore-scripts
shell: bash
85 changes: 71 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,77 @@ on:
# Trigger this workflow also on pull_request events.
pull_request:

jobs:
build:
runs-on: ubuntu-latest
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
rust: [nightly]
runs-on: ${{ matrix.platform }}
steps:
- name: Check out vscode-lingua-franca repository
uses: actions/checkout@v3
- uses: lf-lang/vscode-lingua-franca/.github/actions/build@check-versions
- name: Install pylint
run: python3 -m pip install pylint
- name: Install pnpm
run: npm i -g pnpm
- name: Setup Rust
uses: ATiltedTree/setup-rust@v1
with:
submodules: recursive
fetch-depth: 0
- name: Prepare LF build environment
uses: ./lingua-franca/.github/actions/prepare-build-env
- name: Install VS Code
uses: ./.github/actions/install-code
- name: Build, deploy, and test the VS Code extension
rust-version: ${{ matrix.rust }}
components: clippy
- name: Install RTI
run: |
npm install
npm run test
cd lingua-franca
.github/actions/install-rti/install.sh
cd ..
shell: bash
if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }}
- name: Run tests (Linux)
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test
if: ${{ runner.os == 'Linux' }}
- name: Run tests (non-Linux)
run: npm run test
if: ${{ runner.os != 'Linux' }}
test-dependencies-outdated:
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: lf-lang/vscode-lingua-franca/.github/actions/build@check-versions
- name: Downgrade dependencies
run: |
pip install -I pylint==2.10.0
rustup default 1.26.0
- name: Run tests (Linux)
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test-dependencies-outdated
if: ${{ runner.os == 'Linux' }}
- name: Run tests (non-Linux)
run: npm run test-dependencies-outdated
if: ${{ runner.os != 'Linux' }}
test-dependencies-missing-extended:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: lf-lang/vscode-lingua-franca/.github/actions/build@check-versions
- name: Run tests (Linux)
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test-dependencies-missing-extended
if: ${{ runner.os == 'Linux' }}
- name: Run tests (non-Linux)
run: npm run test-dependencies-missing-extended
if: ${{ runner.os != 'Linux' }}
test-dependencies-missing-basic:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: lf-lang/vscode-lingua-franca/.github/actions/build@check-versions
- name: Run tests (Linux)
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test-dependencies-missing-basic
if: ${{ runner.os == 'Linux' }}
- name: Run tests (non-Linux)
run: npm run test-dependencies-missing-basic
if: ${{ runner.os != 'Linux' }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.jar
*.vsix
.vscode
.vscode-test
node_modules/*
out/*
.gradle/*
Expand Down
67 changes: 67 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"version": "0.2.0",
"configurations": [
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"name": "Launch Extension",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"request": "launch",
"type": "extensionHost"
},
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/test/index"
],
"env": {
"dependencies": "present"
},
"name": "Tests",
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: compile-tests",
"request": "launch",
"runtimeExecutable": "${execPath}",
"type": "extensionHost"
},
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/test/index"
],
"env": {
"dependencies": "missing1"
},
"name": "Tests: Dependencies Missing1",
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: compile-tests",
"request": "launch",
"runtimeExecutable": "${execPath}",
"type": "extensionHost"
},
{
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/test/index"
],
"env": {
"dependencies": "outdated"
},
"name": "Tests: Dependencies Outdated",
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: compile-tests",
"request": "launch",
"runtimeExecutable": "${execPath}",
"type": "extensionHost"
},
]
}
9 changes: 9 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile-tests"
}
]
}
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
lingua-franca/
__pycache__/*
src/**
out/test/**

*.vsix
.gitignore
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ npm run test
```

## Adding tests
Tests are located in the `src` directory and are marked using the `.test.ts` extension. We use [Jest](https://jestjs.io/) as our testing framework.
Tests are located in the `src` directory and are marked using the `.test.ts` extension. We use [Mocha](https://mochajs.org/) as our testing framework.

## Submitting a Pull Request (PR)
Please keep your PRs manageable and easy to review.
Expand Down
8 changes: 0 additions & 8 deletions jest.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion lingua-franca
Submodule lingua-franca updated 78 files
+5 −0 .github/workflows/cpp-tests.yml
+3 −0 .gitmodules
+0 −21 bin/update-rust-runtime.sh
+3 −3 gradle.properties
+7 −7 lib/scripts/include.sh
+3 −3 lib/scripts/launch.sh
+8 −8 oomph/LinguaFranca.setup
+7 −7 org.lflang.diagram/META-INF/MANIFEST.MF
+57 −54 org.lflang.diagram/src/org/lflang/diagram/synthesis/LinguaFrancaSynthesis.java
+17 −2 org.lflang.diagram/src/org/lflang/diagram/synthesis/SynthesisRegistration.java
+2 −2 org.lflang.diagram/src/org/lflang/diagram/synthesis/action/FilterCycleAction.java
+9 −5 org.lflang.diagram/src/org/lflang/diagram/synthesis/action/MemorizingExpandCollapseAction.java
+4 −1 org.lflang.diagram/src/org/lflang/diagram/synthesis/postprocessor/ReactionPortAdjustment.java
+170 −33 org.lflang.diagram/src/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.java
+4 −1 org.lflang.diagram/src/org/lflang/diagram/synthesis/styles/LinguaFrancaStyleExtensions.java
+1 −5 org.lflang.diagram/src/org/lflang/diagram/synthesis/util/LayoutPostProcessing.java
+75 −11 org.lflang.diagram/src/org/lflang/diagram/synthesis/util/ModeDiagrams.java
+5 −5 org.lflang.lfc/build.gradle
+4 −4 org.lflang.targetplatform/org.lflang.targetplatform.target
+3 −3 org.lflang.tests/META-INF/MANIFEST.MF
+49 −1 org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaParsingTest.java
+34 −0 org.lflang.tests/src/org/lflang/tests/compiler/LinguaFrancaValidationTest.java
+1 −1 org.lflang.ui.tests/META-INF/MANIFEST.MF
+1 −1 org.lflang.ui/META-INF/MANIFEST.MF
+8 −4 org.lflang.ui/src/org/lflang/ui/actions/CompileActionHandler.java
+3 −3 org.lflang/META-INF/MANIFEST.MF
+1 −1 org.lflang/src/lib/cpp/reactor-cpp
+13 −1 org.lflang/src/lib/cpp/time_parser.hh
+1 −0 org.lflang/src/lib/rs/reactor-rs
+1 −1 org.lflang/src/lib/ts/reactor-ts
+115 −52 org.lflang/src/org/lflang/ASTUtils.java
+1 −1 org.lflang/src/org/lflang/AstExtensions.kt
+115 −0 org.lflang/src/org/lflang/AttributeUtils.java
+27 −8 org.lflang/src/org/lflang/LinguaFranca.xtext
+1 −1 org.lflang/src/org/lflang/generator/PortInstance.java
+2 −2 org.lflang/src/org/lflang/generator/ReactionInstanceGraph.java
+22 −14 org.lflang/src/org/lflang/generator/ReactorInstance.java
+1 −1 org.lflang/src/org/lflang/generator/RuntimeRange.java
+8 −36 org.lflang/src/org/lflang/generator/c/CGenerator.java
+92 −16 org.lflang/src/org/lflang/generator/c/CModesGenerator.java
+1 −153 org.lflang/src/org/lflang/generator/c/CReactionGenerator.java
+9 −34 org.lflang/src/org/lflang/generator/c/CStateGenerator.java
+7 −2 org.lflang/src/org/lflang/generator/c/CTriggerObjectsGenerator.java
+7 −3 org.lflang/src/org/lflang/generator/cpp/CppStandaloneCmakeGenerator.kt
+2 −0 org.lflang/src/org/lflang/generator/cpp/CppStandaloneGenerator.kt
+13 −8 org.lflang/src/org/lflang/generator/cpp/CppStandaloneMainGenerator.kt
+2 −1 org.lflang/src/org/lflang/generator/python/PythonGenerator.java
+5 −6 org.lflang/src/org/lflang/generator/python/PythonPortGenerator.java
+1 −1 org.lflang/src/org/lflang/generator/python/PythonValidator.java
+0 −11 org.lflang/src/org/lflang/generator/rust/README.md
+14 −1 org.lflang/src/org/lflang/generator/rust/RustGenerator.kt
+10 −15 org.lflang/src/org/lflang/generator/rust/RustModel.kt
+0 −1 org.lflang/src/org/lflang/generator/rust/rust-runtime-version.txt
+56 −13 org.lflang/src/org/lflang/generator/ts/TSGenerator.kt
+32 −4 org.lflang/src/org/lflang/generator/ts/TSReactorGenerator.kt
+7 −2 org.lflang/src/org/lflang/util/LFCommand.java
+189 −0 org.lflang/src/org/lflang/validation/AttributeSpec.java
+56 −19 org.lflang/src/org/lflang/validation/LFValidator.java
+9 −5 pom.xml
+1 −1 test/C/src/Hierarchy.lf
+46 −0 test/C/src/NestedTriggeredReactions.lf
+0 −108 test/C/src/federated/DistributedCountDecentralizedLateDownstream.lf
+90 −0 test/C/src/modal_models/BanksCount3ModesComplex.lf
+40 −0 test/C/src/modal_models/BanksCount3ModesSimple.lf
+65 −0 test/C/src/modal_models/BanksModalStateReset.lf
+54 −0 test/C/src/modal_models/MixedReactions.lf
+41 −0 test/C/src/multiport/DualBanks.lf
+47 −0 test/C/src/multiport/DualBanksMultiport.lf
+47 −0 test/Cpp/src/NestedTriggeredReactions.lf
+88 −0 test/Python/src/modal_models/BanksCount3ModesComplex.lf
+38 −0 test/Python/src/modal_models/BanksCount3ModesSimple.lf
+62 −0 test/Python/src/modal_models/BanksModalStateReset.lf
+100 −0 test/Python/src/modal_models/ModalStateResetAuto.lf
+61 −0 test/TypeScript/src/federated/DistributedLoopedAction.lf
+75 −0 test/TypeScript/src/federated/DistributedLoopedPhysicalAction.lf
+61 −0 test/TypeScript/src/federated/LoopDistributedCentralized.lf
+71 −0 test/TypeScript/src/federated/LoopDistributedDouble.lf
+32 −0 test/TypeScript/src/lib/LoopedActionSender.lf
Loading

0 comments on commit 0de30fc

Please sign in to comment.