Add POSIX file stream fallback #143
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
| name: ParparVM Java Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'vm/**' | |
| - '!vm/**/README.md' | |
| - '!vm/**/readme.md' | |
| - '!vm/**/docs/**' | |
| push: | |
| branches: [ master, main ] | |
| paths: | |
| - 'vm/**' | |
| - '!vm/**/README.md' | |
| - '!vm/**/readme.md' | |
| - '!vm/**/docs/**' | |
| jobs: | |
| vm-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Install native build tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang | |
| # Install JDKs and export their paths | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '8' | |
| - name: Save JDK 8 Path | |
| run: echo "JDK_8_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '11' | |
| - name: Save JDK 11 Path | |
| run: echo "JDK_11_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Save JDK 17 Path | |
| run: echo "JDK_17_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Save JDK 21 Path | |
| run: echo "JDK_21_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '25' | |
| - name: Save JDK 25 Path | |
| run: echo "JDK_25_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| # Restore JDK 8 as the main runner | |
| - name: Restore JDK 8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '8' | |
| cache: 'maven' | |
| - name: Run ParparVM JVM tests | |
| working-directory: vm | |
| run: mvn -B clean package -pl JavaAPI -am -DskipTests && mvn -B test -pl tests -am -DexcludedGroups=benchmark | |
| env: | |
| JDK_8_HOME: ${{ env.JDK_8_HOME }} | |
| JDK_11_HOME: ${{ env.JDK_11_HOME }} | |
| JDK_17_HOME: ${{ env.JDK_17_HOME }} | |
| JDK_21_HOME: ${{ env.JDK_21_HOME }} | |
| JDK_25_HOME: ${{ env.JDK_25_HOME }} | |
| - name: Run ParparVM Benchmark | |
| working-directory: vm | |
| run: mvn -B test -pl tests -am -Dgroups=benchmark -Djacoco.skip=true | |
| env: | |
| JDK_8_HOME: ${{ env.JDK_8_HOME }} | |
| JDK_11_HOME: ${{ env.JDK_11_HOME }} | |
| JDK_17_HOME: ${{ env.JDK_17_HOME }} | |
| JDK_21_HOME: ${{ env.JDK_21_HOME }} | |
| JDK_25_HOME: ${{ env.JDK_25_HOME }} | |
| - name: Publish ByteCodeTranslator quality previews | |
| if: ${{ always() && github.server_url == 'https://github.com' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} | |
| id: publish-bytecode-quality-previews | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| SERVER_URL: ${{ github.server_url }} | |
| REPOSITORY: ${{ github.repository }} | |
| RUN_ID: ${{ github.run_id }} | |
| RUN_ATTEMPT: ${{ github.run_attempt }} | |
| run: | | |
| set -euo pipefail | |
| if [ "${SERVER_URL}" != "https://github.com" ]; then | |
| echo "HTML previews are only published for github.com instances." | |
| exit 0 | |
| fi | |
| coverage_dir="vm/tests/target/site/jacoco" | |
| if [ ! -f "${coverage_dir}/index.html" ]; then | |
| echo "No HTML outputs detected; skipping preview publishing." | |
| exit 0 | |
| fi | |
| run_dir="runs/${RUN_ID}-${RUN_ATTEMPT}" | |
| tmp_dir=$(mktemp -d) | |
| dest_dir="${tmp_dir}/${run_dir}/coverage" | |
| mkdir -p "${dest_dir}" | |
| cp -R "${coverage_dir}/." "${dest_dir}/" | |
| printf '%s\n%s\n%s\n' \ | |
| '# Quality report previews' \ | |
| '' \ | |
| 'This branch is automatically managed by the PR CI workflow and may be force-pushed.' \ | |
| > "${tmp_dir}/README.md" | |
| git -C "${tmp_dir}" init -b previews >/dev/null | |
| git -C "${tmp_dir}" config user.name "github-actions[bot]" | |
| git -C "${tmp_dir}" config user.email "github-actions[bot]@users.noreply.github.com" | |
| git -C "${tmp_dir}" add . | |
| git -C "${tmp_dir}" commit -m "Publish quality report previews for run ${RUN_ID} (attempt ${RUN_ATTEMPT})" >/dev/null | |
| remote_url="${SERVER_URL}/${REPOSITORY}.git" | |
| token_remote_url="${remote_url/https:\/\//https://x-access-token:${GITHUB_TOKEN}@}" | |
| git -C "${tmp_dir}" push --force "${token_remote_url}" previews:quality-report-previews >/dev/null | |
| commit_sha=$(git -C "${tmp_dir}" rev-parse HEAD) | |
| raw_base="https://raw.githubusercontent.com/${REPOSITORY}/${commit_sha}/${run_dir}" | |
| preview_base="https://htmlpreview.github.io/?${raw_base}" | |
| echo "jacoco_url=${preview_base}/coverage/index.html" >> "$GITHUB_OUTPUT" | |
| - name: Generate ByteCodeTranslator quality report | |
| if: ${{ always() }} | |
| env: | |
| QUALITY_REPORT_TARGET_DIRS: vm/tests/target | |
| QUALITY_REPORT_SERVER_URL: ${{ github.server_url }} | |
| QUALITY_REPORT_REPOSITORY: ${{ github.repository }} | |
| QUALITY_REPORT_REF: ${{ github.event.pull_request.head.sha || github.sha }} | |
| QUALITY_REPORT_TITLE: "✅ ByteCodeTranslator Quality Report" | |
| JACOCO_HTML_URL: ${{ steps.publish-bytecode-quality-previews.outputs.jacoco_url }} | |
| run: python3 .github/scripts/generate-quality-report.py | |
| - name: Publish ByteCodeTranslator quality comment | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { publishQualityComment } = require('./.github/scripts/publish-quality-comment.js'); | |
| await publishQualityComment({ | |
| github, | |
| context, | |
| core, | |
| marker: '<!-- bytecode-quality-report -->', | |
| reportPath: 'quality-report.md', | |
| }); |