GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [ci] Improve GH Actions scripts · Issue #2967 · pmd/pmd

[ci] Improve GH Actions scripts #2967

New issue
Copy link
New issue
Copy link
Closed
Closed
[ci] Improve GH Actions scripts#2967
Copy link
Assignees
adangel
Labels
an:enhancementAn improvement on existing features / rulesgithub_actionsPull requests that update Github_actions codein:documentationAffects the documentation [doc]in:pmd-internalsAffects PMD's internals
Milestone
6.34.0

Description

@adangel
adangel
opened on Dec 11, 2020
Issue body actions

This affects at least the following repos: pmd, pmd-designer, build-tools, pmd-regression-tester, pmd-eclipse-plugin
I migrated them in the last month from travis to gh actions and you can see some evolution over the time...
The goal is, that we have a common way for our build/deploy/release scripts, that are shared and reused by all our repos.
Additionally, I don't want to create the next vendor lock-in, so the scripts should be able to be used without github actions as well.

For sharing the scripts, I have something in mind, which I did for the pmd-eclipse-plugin: See function "fetch_ci_scripts" in https://github.com/pmd/pmd-eclipse-plugin/blob/master/.ci/build.sh
The scripts are downloaded from build-tools repo and then executed. We could even version the scripts by downloading the scripts using a specific tag. Alternatively instead of downloading, we could also use git submodules.

Sharing the scripts would allow us to automate the release for pmd-regression-tester as well (currently, the releases need to be created manually on github).

Integration with GH Actions should look always similar: one main build.yaml which calls our own build.sh. All workflows should also work on forked repos without breaking (they might do less, e.g. only build but not deploy)

Suggested task list:

  • Generalize and move all scripts to build-tools. There are a lot more script in pmd repo, that should be moved.
    • e.g. check-environment.sh
    • add locale check (see also [core] PMD 6.30.0 release is not reproducible #2970 ) and explicitly set locale to C.UTF-8 at the beginning of the script, using en_US.UTF-8
  • Use the same approach for sharing secrets. The (gpg) encrypted environment variables could be stored in build-tools as well, also the other secrets like ssh-key and gpg release signing key. For the encrypted files, "gpg --armor" would look nicer than the binary files.
    • build-tools
    • pmd-eclipse-plugin
      • bug with github-releases-api.bash fixed in pmd/build-tools@9c47522
    • pmd-bluej
    • pmd-designer (Update Build scripts pmd-designer#47)
    • pmd-regression-tester (Update Build scripts pmd-regression-tester#87)
      • For pmd-regression-tester, consider to add "target/repositories" as cache directory ✔️
    • pmd [ci] Upgrade build scripts #3220
      • use zulu jdk7 instead of oracle...
      • for the main pmd repo, where we use kotlin/dokka, there is a workaround needed to fetch dependencies until Use maven directly to download additional dependencies Kotlin/dokka#1644 is released. Currently (2021-02-11) the latest version 1.4.20 doesn't include this fix.
        • Update 2021-04-15: Dokka 1.4.30 (https://github.com/Kotlin/dokka/releases/tag/v1.4.30) contains the fix
      • There is one fix, that can be removed probably: for the dokka generated apidocs of pmd-lang-test, there was special handling, which is not needed anymore (see function "pmd_code_fixPmdLangTestStyle" in pmd-code-api.sh). This can probably be removed.
      • Remove old docker build
  • There are still some references to travis, e.g. in the PR template
  • synchronization to sourceforge could be done in a separate job. This job would do the following:
    • ✔️ git repo sync -> from github to sourceforge, on push.
    • ❌ releases sync -> from pmd-code.org to sourceforge, on releases
    • ❌ baseline sync -> from pmd-code.org to sourceforge, on push
    • ❌ doc archive sync -> from pmd-code.org to sourceforge, on releases
    • ❌ snapshot doc sync? on push
    • These could be done later if needed
  • Have a correct and similar build badge on each repo (e.g. currently pmd repo uses the name "Pushes", which should be changed to "Build")
  • Log output should be reduced (e.g. while running maven_dependencies), see also [ci] Cleanup github action logs #3067 - obsolete, since maven_dependencies is not needed anymore
  • Maybe remove travis_wait script. This is probably not needed anymore.
  • Make sure, the we support forked workflows: https://github.community/t/stop-github-actions-running-on-a-fork/17965/2
    "if: github.owner == pmd" or "github.repository_owner == 'pmd'"
    • works ✔️ , e.g. https://github.com/adangel/build-tools/actions
  • move the docker config to build-tools
    • this is basically the environment for testing the scripts and could be used to run the scripts somewhere else (e.g. not on github, if needed)
    • set the correct locale, e.g. en_US.UTF-8, see http://jaredmarkell.com/docker-and-locales/
  • And most important: create a documentation, that describes the solution
    • BUILDING.md, do-release.sh devdocs/development.md, releasing.md
    • describe the needed environment variables, see also below. Preliminary doc is at: https://github.com/pmd/build-tools#private-envasc
    • describe how to test the scripts or run them locally using docker
    • describe integration of danger
  • Figure out, whether we need the jobs for sonar and coveralls (both might have a different github integration anyway)
    • https://sonarcloud.io/dashboard?id=net.sourceforge.pmd%3Apmd
      -> Yes, needed. We use "CI-based analysis method" with Github Actions, see https://sonarcloud.io/documentation
    • https://coveralls.io/github/pmd/pmd
      -> Yes, needed: We don't use the Coveralls Github Actions but the coveralls-maven-plugin. In any case, we need to run tests with coverage recording.

Activity

  1. adangel
    added
    an:enhancementAn improvement on existing features / rules
    github_actionsPull requests that update Github_actions code
    on Dec 11, 2020
  2. adangel
    added this to the 6.31.0 milestone on Dec 11, 2020
  3. adangel
    added
    in:documentationAffects the documentation [doc]
    in:pmd-internalsAffects PMD's internals
    on Dec 11, 2020
  4. adangel commented on Dec 12, 2020

    @adangel
    adangel
    on Dec 12, 2020 · Hidden as resolved
    Author
    show commentMore actions
  5. adangel commented on Dec 12, 2020

    @adangel
    adangel
    on Dec 12, 2020 · Hidden as resolved
    Author
    show commentMore actions
  6. adangel commented on Dec 12, 2020

    @adangel
    adangel
    on Dec 12, 2020 · Hidden as resolved
    Author
    show commentMore actions
  7. adangel
    added 4 commits that reference this issue on Dec 12, 2020

    [ci] Fix build in trunk (#2967)

    139a3f6

    [ci] Use ruby 2.7 for release build (#2967)

    f276eec

    [ci] Install needed gems before rendering release notes (#2967)

    ba0e9ec

    [ci] Fix creating regression tester baseline for release builds (#2967)

    0488c85
  8. rmohan20
    added a commit that references this issue on Dec 15, 2020

    Pulling latest changes from pmd/pmd: 12/15/2020 (#1)

    62c9b8f
  9. adangel
    modified the milestones: 6.31.0, 6.32.0 on Jan 30, 2021
  10. adangel
    self-assigned this
    on Feb 11, 2021
  11. adangel
    modified the milestones: 6.32.0, 6.33.0 on Feb 26, 2021
  12. adangel
    modified the milestones: 6.33.0, 6.34.0 on Mar 26, 2021
  13. adangel
    closed this as completedon Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @adangel
    adangel

Labels

an:enhancementAn improvement on existing features / rulesgithub_actionsPull requests that update Github_actions codein:documentationAffects the documentation [doc]in:pmd-internalsAffects PMD's internals

Type

No type

Projects

No projects

    Milestone

    • 6.34.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.