Skip to content

DRAFT: DGS import dc switch #2993

DRAFT: DGS import dc switch

DRAFT: DGS import dc switch #2993

name: CI on forks - build and tests
on:
pull_request:
permissions: {}
jobs:
build:
name: Build OS ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: github.event.pull_request.head.repo.fork == true
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: ./mvnw -B -ntp -Dpowsybl.docker-unit-tests.skip=false -Pjacoco install
- name: Build with Maven (Windows)
if: matrix.os == 'windows-latest'
run: mvnw.cmd -B -ntp verify -Dpowsybl.checks.skip=true
shell: cmd
- name: Build with Maven (MacOS)
if: matrix.os == 'macos-latest'
run: ./mvnw -B -ntp verify -Dpowsybl.checks.skip=true
- name: Regroup dependencies in target folders
if: matrix.os == 'ubuntu-latest'
run: ./mvnw dependency:copy-dependencies
- name: Save classes and Jacoco report
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
with:
name: data-for-sonar-analysis-${{ github.event.pull_request.number }}
retention-days: 1
path: |
*/target/classes
*/*/target/classes
*/*/*/target/classes
*/target/generated-sources
*/*/target/generated-sources
*/*/*/target/generated-sources
distribution-core/target/dependency
distribution-core/target/site/jacoco-aggregate/jacoco.xml
- name: Save PR Information
if: matrix.os == 'ubuntu-latest'
env:
REPO_NAME: ${{ github.event.pull_request.head.repo.full_name }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
mkdir -p pr-info
echo "$REPO_NAME" > pr-info/repo-name
echo "$HEAD_REF" > pr-info/head-ref
echo "$HEAD_SHA" > pr-info/head-sha
echo "$PR_NUMBER" > pr-info/pr-number
echo "$BASE_REF" > pr-info/base-ref
- name: Upload PR Information
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
with:
name: pr-info-${{ github.event.pull_request.number }}
path: pr-info/
retention-days: 1