Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework GitHub workflows #178

Merged
merged 18 commits into from
Nov 7, 2024
Merged

Rework GitHub workflows #178

merged 18 commits into from
Nov 7, 2024

Conversation

jeandemanged
Copy link
Member

@jeandemanged jeandemanged commented Oct 15, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Refactor

What is the current behavior?

many workflows a bit complicated

What is the new behavior (if this is a feature change)?
Three workflows: Dev, Full, and Release.

Dev:

  • triggered on PRs or manually(workflow_dispatch) . If manual run, option to produce artifacts.
  • Java:
    • 3 OSs: Windows, Linux(Ubuntu), macOS
    • build and test on all 3 OSs
    • Linux(Ubuntu) only: sonar.
  • C++:
    • 3 OSs: Ubuntu, OL8, CentOS7
    • build and test on all 3 OSs
    • Linux(Ubuntu) only:
      • Sonar - coverage computed on reduced set of Metrix tests
      • Clang Tidy report on PR modified C++ sources

Note that earlier workflows were not running C++ builts when no C++ files modified. This behavior was NOT retained. Reason: it is confusing to see in GitHub PR the checks being required but not launched …

Full: Same as Dev CI, except:

  • triggered on protected branches and tags
  • C++:
    • Linux(Ubuntu) only:
      • Sonar - coverage computed on complete set of Metrix tests
      • Clang Tidy report on all C++ sources

Release:

  • triggered on release creation
  • Java:
    • Linux(Ubuntu) only: build, test, upload itools-metrix.zip
  • C++:
    • 3 OSs: Ubuntu, OL8, CentOS7
    • build, test, upload metrix-simulator-.zip

Does this PR introduce a breaking change or deprecate an API?

  • No

Other information:

Clang Tidy report job had issues which have been fixed.

Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
Signed-off-by: Damien Jeandemange <[email protected]>
@jeandemanged jeandemanged changed the title [WIP] try rework github workflows [WIP] Rework GitHub workflows Nov 6, 2024
Signed-off-by: Damien Jeandemange <[email protected]>
@jeandemanged jeandemanged changed the title [WIP] Rework GitHub workflows Rework GitHub workflows Nov 6, 2024
Copy link
Member

@rolnico rolnico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remember to delete the old files :)

echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"

- name: Upload release package
uses: softprops/action-gh-release@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9

echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"

- name: Upload release package
uses: softprops/action-gh-release@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9

run: ./mvnw --batch-mode package

- name: Upload release package
uses: softprops/action-gh-release@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9

echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT"

- name: Upload release package
uses: softprops/action-gh-release@v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1

name: Dev CI

on:
workflow_dispatch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the workflow_dispatch trigger on the action page yet, is it normal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that we have to wait that the PR is merged...

meanwhile it can be triggered by GitHub CLI using:

gh workflow run --ref=gh-workflows

See https://stackoverflow.com/a/67840292 and its most upvoted comment explaining the trick which I applied for Dev CI.

I re-ran it here: https://github.com/powsybl/powsybl-metrix/actions/runs/11706681139

@@ -0,0 +1,322 @@
name: Full CI

on:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add:

Suggested change
on:
on:
workflow_dispatch:

?

Signed-off-by: Damien Jeandemange <[email protected]>
Copy link

sonarcloud bot commented Nov 6, 2024

Copy link

sonarcloud bot commented Nov 6, 2024

@rolnico rolnico merged commit dcb11db into main Nov 7, 2024
20 checks passed
@rolnico rolnico deleted the gh-workflows branch November 7, 2024 13:38
rolnico pushed a commit that referenced this pull request Nov 7, 2024
* try rework github workflows

Signed-off-by: Damien Jeandemange <[email protected]>

* try rework github workflows

Signed-off-by: Damien Jeandemange <[email protected]>

* clang tidy

Signed-off-by: Damien Jeandemange <[email protected]>

* clang tidy

Signed-off-by: Damien Jeandemange <[email protected]>

* clang tidy

Signed-off-by: Damien Jeandemange <[email protected]>

* clang tidy

Signed-off-by: Damien Jeandemange <[email protected]>

* clang tidy

Signed-off-by: Damien Jeandemange <[email protected]>

* clang tidy

Signed-off-by: Damien Jeandemange <[email protected]>

* artifacts

Signed-off-by: Damien Jeandemange <[email protected]>

* artifacts

Signed-off-by: Damien Jeandemange <[email protected]>

* artifacts

Signed-off-by: Damien Jeandemange <[email protected]>

* artifacts

Signed-off-by: Damien Jeandemange <[email protected]>

* wip

Signed-off-by: Damien Jeandemange <[email protected]>

* fix

Signed-off-by: Damien Jeandemange <[email protected]>

* use softprops/action-gh-release

Signed-off-by: Damien Jeandemange <[email protected]>

* fix

Signed-off-by: Damien Jeandemange <[email protected]>

---------

Signed-off-by: Damien Jeandemange <[email protected]>
(cherry picked from commit dcb11db)
@jeandemanged jeandemanged linked an issue Nov 8, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clang-Tidy job in CI does not work
2 participants