Test2 test2 #103
Workflow file for this run
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: Snapshot CI | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - 'ci/**-**' | |
| jobs: | |
| build: | |
| name: Build and test on ${{ matrix.os }} with ${{ matrix.jvm }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| jvm: [java, graalvm] | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Extract version from branch | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| TARGET_BRANCH="${{ github.event.pull_request.base.ref }}" | |
| echo "Full target branch: $TARGET_BRANCH" | |
| VERSION="${TARGET_BRANCH#*-}" | |
| echo "Extracted version: $VERSION" | |
| echo "SNAPSHOT_VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Check Version | |
| run: echo $SNAPSHOT_VERSION | |
| - name: Setup GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '21' | |
| distribution: 'graalvm' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up script path | |
| run: | | |
| SCRIPTS_PATH="${GITHUB_WORKSPACE}/scripts/.github/workflows/scripts" | |
| if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
| SCRIPTS_PATH=$(echo "$SCRIPTS_PATH" | sed 's/\\/\//g') | |
| fi | |
| echo "SCRIPTS_PATH=$SCRIPTS_PATH" >> $GITHUB_ENV | |
| - name: Checkout script | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| .github | |
| sparse-checkout-cone-mode: false | |
| path: scripts | |
| # Build powsybl-core | |
| - name: Checking for powsybl-core snapshot branch | |
| run: ${{ env.SCRIPTS_PATH }}/check_snapshot_branch.sh "https://github.com/powsybl/powsybl-open-loadflow.git" ${{ env.SNAPSHOT_VERSION }} | |
| - name: Checkout core sources | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: powsybl/powsybl-core | |
| ref: ${{ env.SNAPSHOT_BRANCH }} | |
| path: powsybl-core | |
| - name: Build powsybl-core | |
| run: mvn -batch-mode --no-transfer-progress clean install -DskipTests | |
| working-directory: ./powsybl-core | |
| - name: Get CORE_VERSION | |
| run: echo "CORE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
| working-directory: ./powsybl-core | |
| # Build powsybl-open-loadflow | |
| - name: Checking for powsybl-open-loadflow snapshot branch | |
| run: ${{ env.SCRIPTS_PATH }}/check_snapshot_branch.sh "https://github.com/powsybl/powsybl-open-loadflow.git" ${{ env.SNAPSHOT_VERSION }} | |
| - name: Checkout powsybl-open-loadflow sources | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: powsybl/powsybl-open-loadflow | |
| ref: ${{ env.SNAPSHOT_BRANCH }} | |
| path: powsybl-open-loadflow | |
| - name: Change core version in pom.xml | |
| run: mvn versions:set-property -Dproperty=powsybl-core.version -DnewVersion=${{ env.CORE_VERSION }} -DgenerateBackupPoms=false | |
| working-directory: ./powsybl-open-loadflow | |
| - name: Build powsybl-open-loadflow | |
| run: mvn -batch-mode --no-transfer-progress clean install | |
| working-directory: ./powsybl-open-loadflow | |
| - name: Get OLF_VERSION | |
| run: echo "OLF_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
| working-directory: ./powsybl-open-loadflow | |
| # Build powsybl-entsoe | |
| - name: Checking for powsybl-entsoe snapshot branch | |
| run: ${{ env.SCRIPTS_PATH }}/check_snapshot_branch.sh "https://github.com/powsybl/powsybl-entsoe.git" ${{ env.SNAPSHOT_VERSION }} | |
| - name: Checkout powsybl-entsoe sources | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: powsybl/powsybl-entsoe | |
| ref: ${{ env.SNAPSHOT_BRANCH }} | |
| path: powsybl-entsoe | |
| - name: Change core/loadflow version in pom.xml | |
| run: | | |
| mvn versions:set-property -Dproperty=powsyblcore.version -DnewVersion=${{ env.CORE_VERSION }} -DgenerateBackupPoms=false | |
| mvn versions:set-property -Dproperty=powsyblopenloadflow.version -DnewVersion=${{ env.OLF_VERSION }} -DgenerateBackupPoms=false | |
| working-directory: ./powsybl-entsoe | |
| - name: Build powsybl-entsoe | |
| run: mvn -batch-mode --no-transfer-progress clean install | |
| working-directory: ./powsybl-entsoe | |
| - name: Get ENTSOE_VERSION | |
| run: echo "ENTSOE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
| working-directory: ./powsybl-entsoe | |
| # Build powsybl-open-rao | |
| - name: Checkout powsybl-open-rao sources | |
| uses: actions/checkout@v4 | |
| with: | |
| path: powsybl-openrao | |
| - name: Change core/entsoe/loadflow version in pom.xml | |
| run: | | |
| mvn versions:set-property -Dproperty=powsybl.core.version -DnewVersion=${{ env.CORE_VERSION }} -DgenerateBackupPoms=false | |
| mvn versions:set-property -Dproperty=powsybl.entsoe.version -DnewVersion=${{ env.ENTSOE_VERSION }} -DgenerateBackupPoms=false | |
| mvn versions:set-property -Dproperty=powsybl.openloadflow.version -DnewVersion=${{ env.OLF_VERSION }} -DgenerateBackupPoms=false | |
| working-directory: ./powsybl-openrao | |
| - name: Build with Maven | |
| if: matrix.os == 'ubuntu-latest' | |
| run: mvn --batch-mode -Pjacoco install -DskipCucumberTests=true | |
| working-directory: ./powsybl-openrao | |
| - name: Build with Maven | |
| if: matrix.os != 'ubuntu-latest' | |
| run: mvn --batch-mode install -DskipCucumberTests=true | |
| working-directory: ./powsybl-openrao | |
| - name: Run SonarCloud analysis | |
| if: matrix.os == 'ubuntu-latest' | |
| run: > | |
| mvn --batch-mode -DskipTests sonar:sonar | |
| -Dsonar.host.url=https://sonarcloud.io | |
| -Dsonar.organization=powsybl-ci-github | |
| -Dsonar.projectKey=com.powsybl:open-rao | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| working-directory: ./powsybl-openrao | |
| - name: Run cucumber tests | |
| run: mvn test -pl tests | |
| working-directory: ./powsybl-openrao |