Skip to content

[rubysrc2cpg] fix thread-safety race condition in prism loading #10046

[rubysrc2cpg] fix thread-safety race condition in prism loading

[rubysrc2cpg] fix thread-safety race condition in prism loading #10046

Workflow file for this run

name: pr
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: 21
cache: sbt
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Check formatting
run: sbt scalafmtCheck Test/scalafmtCheck
- run: echo "Previous step failed because code is not formatted. Run 'sbt scalafmt Test/scalafmt'"
if: ${{ failure() }}
- name: Validate CITATION.cff
uses: dieghernan/cff-validator@d8f85828214016ce6976e740b6e0504c0fdc4dbb # v5
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- name: Fetch base branch with depth 1
run: git fetch --depth=1 origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
- name: Set up JDK
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: 21
cache: sbt
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Run scalafix linting
run: sbt "scalafix --diff-base origin/${{ github.event.pull_request.base.ref }} RestrictedImports SingleLetterIdentifiers UnorderedIteration"
- run: echo "Previous step failed because certain coding quality expectations were violated. Please check the logs."
if: ${{ failure() }}
test:
needs: [formatting, linting]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: 21
cache: sbt
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Install php
if: matrix.os == 'macos-latest'
run: brew install php
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
cache: false
go-version: 1.25
- name: Set up Swift (macos-latest)
if: matrix.os == 'macos-latest'
uses: SwiftyLab/setup-swift@38f54a76b70d989321de9dc7c840618c08cf56e9 # v1.14.0
# macos-latest runner switched to Xcode 26.4.1 as the new default
# Some swiftsrc2cpg tests use `import Foundation` which can not be
# compiled with an incompatible toolchain/SDK combination.
#
# error: failed to build module 'Darwin'; this SDK is not supported by the compiler
# (the SDK is built with 'Apple Swift version 6.3.2 (swiftlang-6.3.2.1.2 clang-2100.0.123.2)',
# while this compiler is 'Apple Swift version 6.1.3 (swift-6.1.3-RELEASE)').
# Please select a toolchain which matches the SDK.
#
# See: https://github.com/actions/runner-images/issues/14167
with:
swift-version: "6.3"
- name: Set up Swift
if: matrix.os != 'macos-latest'
uses: SwiftyLab/setup-swift@38f54a76b70d989321de9dc7c840618c08cf56e9 # v1.14.0
with:
swift-version: "6.1"
- name: Set up Rust
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # v1
with:
toolchain: stable
components: rust-src
- name: Run tests
run: sbt clean test
test-scripts:
needs: [formatting, linting]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- name: Set up JDK
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: 21
cache: sbt
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Install coreutils
if: matrix.os == 'macos-latest'
run: brew install coreutils
- name: Install php
if: matrix.os == 'macos-latest'
run: brew install php
- name: Install Python dependencies for distribution test (Linux, MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
python -m pip install requests pexpect
- name: Install Python dependencies for distribution test (Windows)
if: matrix.os == 'windows-latest'
run: |
python -m pip install setuptools<81
python -m pip install requests wexpect
- name: Test distribution
run: |
sbt joerncli/stage querydb/createDistribution
python -u ./testDistro.py