Skip to content

Commit

Permalink
Recover original CI executions
Browse files Browse the repository at this point in the history
- Unnecessary removals from CI are recovered.
  • Loading branch information
chanijjani committed Feb 12, 2024
1 parent 1a57163 commit 023c54d
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 57 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/all-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,31 @@ concurrency:
jobs:
check-diff:
uses: ./.github/workflows/check-diff.yml

# Test the Gradle build.
building:
needs: check-diff
uses: ./.github/workflows/build.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}
if: ${{ needs.check-diff.outputs.run_build == 'true' }}

# Run tests for the standalone compiler.
cli:
if: ${{ needs.check-diff.outputs.run_misc == 'true' }}
needs: check-diff
uses: ./.github/workflows/cli-tests.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}

# Run language server tests.
lsp:
if: ${{ needs.check-diff.outputs.run_misc == 'true' }}
needs: check-diff
uses: ./.github/workflows/lsp-tests.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}

check-labels:
uses: ./.github/workflows/check-labels.yml
if: ${{ github.event_name == 'pull_request' }}
30 changes: 30 additions & 0 deletions .github/workflows/all-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,35 @@ concurrency:
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: ${{ needs.check-diff.outputs.run_c == 'true' }}

cpp:
uses: ./.github/workflows/only-cpp.yml
needs: check-diff
if: ${{ needs.check-diff.outputs.run_cpp == 'true' }}

py:
uses: ./.github/workflows/only-py.yml
needs: check-diff
if: ${{ needs.check-diff.outputs.run_py == 'true' || needs.check-diff.outputs.run_c == 'true' }}

rs:
uses: ./.github/workflows/only-rs.yml
needs: check-diff
if: ${{ needs.check-diff.outputs.run_rs == 'true' }}

ts:
uses: ./.github/workflows/only-ts.yml
needs: check-diff
if: ${{ needs.check-diff.outputs.run_ts == 'true' }}

serialization:
if: ${{ needs.check-diff.outputs.run_c == 'true' || needs.check-diff.outputs.run_py == 'true' || needs.check-diff.outputs.run_ts == 'true' }}
needs: check-diff
uses: ./.github/workflows/serialization-tests.yml
24 changes: 5 additions & 19 deletions .github/workflows/c-tests-with-rust-rti.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
name: C tests
name: C tests with Rust RTI

on:
workflow_call:
inputs:
compiler-ref:
required: false
type: string
runtime-ref:
required: false
type: string
use-cpp:
required: false
type: boolean
default: false
scheduler:
required: false
type: string
all-platforms:
required: false
default: true
Expand All @@ -27,17 +14,16 @@ jobs:
matrix:
platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest"]')) || fromJSON('["ubuntu-latest"]') }}
runs-on: ${{ matrix.platform }}
timeout-minutes: 120
timeout-minutes: 10

steps:
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
repository: chanijjani/lingua-franca
submodules: true
ref: ${{ inputs.compiler-ref }}
fetch-depth: 0
- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Perform federated tests for C target with Rust RTI and default scheduler
run: ./gradlew targetTest -Ptarget=RustRti
if: ${{ !inputs.use-cpp && !inputs.scheduler }}
- name: Perform federated tests for C target with Rust RTI
run: git checkout integration_tests_with_rust_rti; ./gradlew targetTest -Ptarget=RustRti
31 changes: 29 additions & 2 deletions .github/workflows/only-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,35 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
# Run the C integration tests with Rust RTI.
# Run the C integration tests.
default:
uses: ./.github/workflows/c-tests-with-rust-rti.yml
uses: ./.github/workflows/c-tests.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}

# Run the C benchmark tests.
benchmarking:
uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main
with:
target: "C"

# Run the C Arduino integration tests.
arduino:
uses: ./.github/workflows/c-arduino-tests.yml
with:
all-platforms: ${{ !github.event.pull_request.draft }}

# Run the C Zephyr integration tests.
zephyr:
uses: ./.github/workflows/c-zephyr-tests.yml

# Run the CCpp integration tests.
ccpp:
uses: ./.github/workflows/c-tests.yml
with:
use-cpp: true
all-platforms: ${{ !github.event.pull_request.draft }}

# Run the Uclid-based LF Verifier benchmarks.
verifier:
uses: ./.github/workflows/c-verifier-tests.yml
12 changes: 0 additions & 12 deletions core/src/integrationTest/java/org/lflang/tests/RuntimeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,6 @@ public void runFederatedTests() {
false);
}

@Test
public void runFederatedTestsWithRustRti() {
Assumptions.assumeTrue(supportsFederatedExecution(), Message.NO_FEDERATION_SUPPORT);
runTestsForTargetsWithRustRti(
Message.DESC_FEDERATED,
TestCategory.FEDERATED::equals,
Transformers::noChanges,
Configurators::noChanges,
TestLevel.EXECUTION,
false);
}

/** Run the tests for modal reactors. */
@Test
public void runModalTests() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
***************/
package org.lflang.tests.runtime;

import java.nio.file.Path;

import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.lflang.target.Target;
import org.lflang.tests.SimplifiedRuntimeTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ public boolean doGenerate(Resource resource, LFGeneratorContext context) throws
* @param context The context in which to carry out the code generation.
* @return False if no errors have occurred, true otherwise.
*/
public boolean doGenerateForRustRTI(Resource resource, LFGeneratorContext context) throws IOException {
if (!federatedExecutionIsSupported(resource)) return true;
public boolean doGenerateForRustRTI(Resource resource, LFGeneratorContext context)
throws IOException {
if (!federatedExecutionIsSupported(resource)) return true;
cleanIfNeeded(context);

// In a federated execution, we need keepalive to be true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,18 @@ private String getLaunchCodeForRustRti() {
"# The RTI will be brought back to foreground",
"# to be responsive to user inputs after all federates",
"# are launched.",
"LF_RUST_RTI_PATH=`find ~/ -name lf-rust-rti`",
"echo LF_RUST_RTI_PATH=${LF_RUST_RTI_PATH}",
"if [ \"${LF_RUST_RTI_PATH}\" = \"\" ]; then",
"git clone https://github.com/hokeun/lf-rust-rti.git",
"cd lf-rust-rti/rust/rti",
"RUST_RTI_REMOTE_PATHS=`find ~/ -name rti_remote.rs`",
"if [ \"${RUST_RTI_REMOTE_PATHS}\" = \"\" ]; then",
" git clone https://github.com/hokeun/lf-rust-rti.git",
" cd lf-rust-rti/rust/rti",
"else",
"cd ${LF_RUST_RTI_PATH}/rust/rti",
"fi",
" FIRST_RUST_RTI_REMOTE_PATH=($RUST_RTI_REMOTE_PATHS)",
" FIRST_RUST_RTI_PATH=${FIRST_RUST_RTI_REMOTE_PATH[0]%/*}",
" cd ${FIRST_RUST_RTI_PATH}; cd ../",
"fi",
"cargo run -- -i ${FEDERATION_ID} \\",
" -n 2 \\",
" -c init \\",
"-n 2 \\",
"-c init \\",
"&",
"# Store the PID of the RTI",
"RTI=$!",
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/org/lflang/generator/LFGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorCont
}
}

public void doGenerateForRustRTI(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
public void doGenerateForRustRTI(
Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
assert injector != null;
final LFGeneratorContext lfContext;
if (context instanceof LFGeneratorContext) {
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/org/lflang/target/Target.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,12 @@ public enum Target {
// with the syntax r#keyword.
Arrays.asList("self", "true", "false")),
RustRti(
"RustRti",
true,
// In our Rust implementation, the only reserved keywords
// are those that are a valid expression. Others may be escaped
// with the syntax r#keyword.
Arrays.asList("self", "true", "false"));
"RustRti",
true,
// In our Rust implementation, the only reserved keywords
// are those that are a valid expression. Others may be escaped
// with the syntax r#keyword.
Arrays.asList("self", "true", "false"));

/** String representation of this target. */
private final String displayName;
Expand Down
5 changes: 3 additions & 2 deletions core/src/testFixtures/java/org/lflang/tests/TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ protected void runTestsForTargetsWithRustRti(
TestLevel level,
boolean copy) {
for (Target target : this.targets) {
runTestsForRustRti(List.of(target), description, selected, transformer, configurator, level, copy);
runTestsForRustRti(
List.of(target), description, selected, transformer, configurator, level, copy);
}
}

Expand Down Expand Up @@ -807,7 +808,7 @@ private void validateAndRun(

System.out.print(System.lineSeparator());
}

/**
* Validate and run the given tests, using the specified configuratator and level.
*
Expand Down

0 comments on commit 023c54d

Please sign in to comment.