Java CI - Main #182
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Ant | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant | |
name: Java CI - Main | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Daily at midnight | |
schedule: | |
- cron: '0 0 * * *' | |
permissions: | |
checks: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Because of scheduled runs, by default run on default branch | |
with: | |
ref: main | |
path: workspace/coral | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Check out specs-java-libs repo | |
uses: actions/checkout@v4 | |
with: | |
repository: specs-feup/specs-java-libs | |
path: workspace/specs-java-libs | |
- name: Check out lara-framework repo | |
uses: actions/checkout@v4 | |
with: | |
repository: specs-feup/lara-framework | |
ref: master | |
path: workspace/lara-framework | |
- name: Check out Clava repo | |
uses: actions/checkout@v4 | |
with: | |
repository: specs-feup/clava | |
ref: master | |
path: workspace/clava | |
- name: Check out clava-flow in the compatible version | |
uses: actions/checkout@v4 | |
with: | |
repository: specs-feup/clava-flow | |
#ref: a504de47349e525c778ccb34c14836a0cb9af7ae | |
path: workspace/clava-flow | |
- name: Create package.json | |
working-directory: workspace | |
run: | | |
touch package.json | |
echo '{"name": "myPackage", "type": "module", "workspaces": ["clava/Clava-JS", "lara-framework/Lara-JS", "coral", "clava-flow"]}' >> package.json | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install node libraries | |
working-directory: workspace | |
run: | | |
npm i | |
npm run build -w lara-framework/Lara-JS | |
npm run build -w clava/Clava-JS | |
npm run build -w clava-flow | |
npm run build -w coral | |
npm i | |
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | |
# Setting up gradle multi-project would be helpful | |
- name: InstallDist Clava | |
working-directory: workspace/clava/ClavaWeaver | |
run: gradle installDist | |
- name: Put java binary in Clava-JS | |
working-directory: workspace | |
run: | | |
mkdir clava/Clava-JS/java-binaries | |
cp -r ./clava/ClavaWeaver/build/install/ClavaWeaver ./clava/Clava-JS/java-binaries | |
- name: Run CORAL tests | |
working-directory: workspace/coral | |
run: | | |
npm run test | |
if [ -f out/.failed ]; then exit 1; fi |