nightly #254
This file contains hidden or 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 the whole project every day at midnight | |
| # It will build the Java part and the JS part | |
| # Every push to a branch will trigger the build | |
| # Every pull request will trigger the build | |
| name: nightly | |
| on: | |
| push: | |
| pull_request: | |
| # Daily at midnight | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: | |
| checks: write | |
| contents: write | |
| env: | |
| JAVA_VERSION: 21 | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| # Setting default branch to staging assuming PRs will be done against the staging versions of the repository | |
| # main versions will just receive what comes from the staging | |
| DEFAULT_BRANCH: ${{ github.event.pull_request.base.ref || 'staging' }} | |
| #SPECS_JAVA_LIBS_BRANCH: ${{ 'master' }} | |
| #LARA_FRAMEWORK_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| jobs: | |
| build-java: | |
| name: Build Java | |
| runs-on: ubuntu-latest | |
| outputs: | |
| branch-exists-lara-framework: ${{ steps.Branch-lara-framework.outputs.value }} | |
| branch-exists-specs-java-libs: ${{ steps.Branch-specs-java-libs.outputs.value }} | |
| steps: | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: current | |
| dependency-graph: generate-and-submit | |
| - name: Checkout Fortran Transpiler | |
| uses: actions/checkout@v4 | |
| with: | |
| path: fortran-transpiler | |
| - name: Check if branch exists on lara-framework | |
| id: Branch-lara-framework | |
| run: echo "value=$(git ls-remote --heads https://github.com/specs-feup/lara-framework.git refs/heads/${{ env.BRANCH_NAME }} | wc -l)" >> $GITHUB_OUTPUT | |
| - name: Check if branch exists on specs-java-libs | |
| id: Branch-specs-java-libs | |
| run: echo "value=$(git ls-remote --heads https://github.com/specs-feup/specs-java-libs.git refs/heads/${{ env.BRANCH_NAME }} | wc -l)" >> $GITHUB_OUTPUT | |
| - name: Echo checks | |
| run: | | |
| echo "Branch-lara-framework: ${{ steps.Branch-lara-framework.outputs.value }}" | |
| echo "Branch-specs-java-libs: ${{ steps.Branch-specs-java-libs.outputs.value }}" | |
| echo "Branch name: ${{ env.BRANCH_NAME }}" | |
| echo "Default branch: ${{ env.DEFAULT_BRANCH }}" | |
| echo "Branch base_ref: ${{ github.base_ref }}" | |
| - name: Checkout lara-framework | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: specs-feup/lara-framework | |
| path: lara-framework | |
| ref: ${{ steps.Branch-lara-framework.outputs.value == '1' && env.BRANCH_NAME || env.DEFAULT_BRANCH }} | |
| - name: Checkout specs-java-libs | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: specs-feup/specs-java-libs | |
| path: specs-java-libs | |
| # This is causing problems in PRs, for now it will always be the default branch | |
| #ref: ${{ steps.Branch-specs-java-libs.outputs.value == '1' && env.BRANCH_NAME || env.DEFAULT_BRANCH }} | |
| - name: Checkout flang dumper, to install flang-20 | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: specs-feup/flang-dumper | |
| path: flang-dumper | |
| ref: main | |
| - name: Install flang-20 | |
| run: | | |
| cd flang-dumper/scripts | |
| sudo ./install-dependencies.sh | |
| - name: Test FortranAst | |
| run: | | |
| cd fortran-transpiler/FortranAst | |
| gradle test | |
| env: | |
| GITHUB_DEPENDENCY_GRAPH_ENABLED: false | |
| - name: Test FortranParser | |
| run: | | |
| cd fortran-transpiler/FortranParser | |
| gradle test | |
| env: | |
| GITHUB_DEPENDENCY_GRAPH_ENABLED: false | |
| - name: Test FortranWeaver | |
| run: | | |
| cd fortran-transpiler/FortranWeaver | |
| gradle test | |
| env: | |
| GITHUB_DEPENDENCY_GRAPH_ENABLED: false | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v4 | |
| if: always() | |
| with: | |
| report_paths: './**/build/test-results/test/TEST-*.xml' | |
| summary: true | |