From 379d5b89ce6f6aabb0c6e56fe36e6f9afd43be99 Mon Sep 17 00:00:00 2001 From: Andrew Byrd Date: Fri, 13 Jan 2023 23:22:39 +0800 Subject: [PATCH] switch cypress integration testing to use gradle Update Github actions versions. Use Java 19. Set max heap to 7G using dedicated parameter. Use UI commit where 'yarn start-backend' performs 'gradle runBackend'. --- .github/workflows/cypress-integration.yml | 30 ++++++++++------------- build.gradle | 1 + 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cypress-integration.yml b/.github/workflows/cypress-integration.yml index 0fd16c257..c97742540 100644 --- a/.github/workflows/cypress-integration.yml +++ b/.github/workflows/cypress-integration.yml @@ -12,36 +12,32 @@ jobs: runs-on: ubuntu-latest steps: - # Checkout each repo into sub-directories - - uses: actions/checkout@v2 + # Checkout each the UI and R5 into separate subdirectories + - uses: actions/checkout@v3 with: repository: conveyal/analysis-ui ref: 1701bd9aea859a4714bc3f35f5bcf767a3256a64 + fetch-depth: 0 path: ui - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 path: r5 - # Build .jar and copy to ./ui directory (along with config file) - # Cache Gradle dependencies to speed up the shadow jar build - - uses: actions/cache@v1 - id: cache - with: - path: ~/.gradle/caches - key: gradle-caches - - uses: actions/setup-java@v1 + # Build R5 and check that it can start up as a backend + - uses: actions/setup-java@v3 with: - java-version: 11 - - run: gradle shadowJar -x test + distribution: temurin + java-version: 19 + cache: gradle + - run: | + cp analysis.properties.template analysis.properties + gradle testRunnable -x test working-directory: r5 - - run: cp $(ls ./r5/build/libs/*-all.jar | head -n1) ./ui/latest.jar - - run: cp ./r5/analysis.properties.template ./ui/analysis.properties - # Install / cache dependencies with Cypress to handle caching Cypress binary. - uses: actions/setup-node@v2 with: node-version: '12' - - uses: cypress-io/github-action@v2 + - uses: cypress-io/github-action@v3 env: NEXT_PUBLIC_BASEMAP_DISABLED: true NEXT_PUBLIC_CYPRESS: true diff --git a/build.gradle b/build.gradle index faf1df236..4f93bd941 100644 --- a/build.gradle +++ b/build.gradle @@ -83,6 +83,7 @@ application { // Run R5 as a local analysis backend with all dependencies on the classpath, without building a shadowJar. task runBackend (type: JavaExec) { dependsOn(build) + maxHeapSize('7G') classpath(sourceSets.main.runtimeClasspath) main("com.conveyal.analysis.BackendMain") }