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

Refactor GHA scripts to be more version aware #77

Merged
merged 9 commits into from
May 1, 2024

Conversation

heitbaum
Copy link
Collaborator

@heitbaum heitbaum commented Feb 7, 2024

refactor the scripts to:

  • change LE10 build process to build with a matched version make-image and create-addon
  • change LE11 build process to build with a matched version make-image and create-addon
  • change LE12 build process to build with a matched version make-image and create-addon
    • rename the MASTER target to LE12 to simplify management of build scripts.

This ensures consistency of build system for the duration of the release lifecycle. As LE13 is to have an updated make-image and create-addon that will use the at time current Ubuntu LTS version (noble.)

@heitbaum
Copy link
Collaborator Author

heitbaum commented Feb 7, 2024

I have reviewed (and fixed some of reviewdog and shellcheck)

these are the remaining that can be reviewed in the future - but will need further testing (I installed actionslint and shellcheck locally)

also we need to look at allowing nightly and scripts in the actionslint config.
label "nightly" is unknown. available labels are

$ actionlint | … | uniq -c 
      6 shellcheck reported issue in this script: SC2001:style:6:12: See if you can use ${variable//search/replace} instead [shellcheck]
      6 shellcheck reported issue in this script: SC2001:style:7:115: See if you can use ${variable//search/replace} instead [shellcheck]
      6 shellcheck reported issue in this script: SC2001:style:7:85: See if you can use ${variable//search/replace} instead [shellcheck]
      6 shellcheck reported issue in this script: SC2006:style:5:20: Use $(...) notation instead of legacy backticks `...` [shellcheck]
      6 shellcheck reported issue in this script: SC2046:warning:2:44: Quote this to prevent word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2046:warning:5:20: Quote this to prevent word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2046:warning:6:10: Quote this to prevent word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2046:warning:7:113: Quote this to prevent word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2046:warning:7:83: Quote this to prevent word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2086:info:11:40: Double quote to prevent globbing and word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2086:info:12:130: Double quote to prevent globbing and word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2086:info:12:138: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:20:45: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:20:50: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:21:155: Double quote to prevent globbing and word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2086:info:2:22: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:2:98: Double quote to prevent globbing and word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2086:info:3:22: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:3:28: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:4:28: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:5:33: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:5:72: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:6:109: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:6:17: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:6:29: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:6:45: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:7:100: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:7:120: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:7:70: Double quote to prevent globbing and word splitting [shellcheck]
      6 shellcheck reported issue in this script: SC2086:info:7:90: Double quote to prevent globbing and word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2086:info:8:36: Double quote to prevent globbing and word splitting [shellcheck]
      3 shellcheck reported issue in this script: SC2086:info:8:44: Double quote to prevent globbing and word splitting [shellcheck]
      1 shellcheck reported issue in this script: SC2095:info:10:17: ssh may swallow stdin, preventing this loop from working properly [shellcheck]
      1 shellcheck reported issue in this script: SC2095:warning:12:19: Use ssh -n to prevent ssh from swallowing stdin [shellcheck]
      1 shellcheck reported issue in this script: SC2162:info:10:23: read without -r will mangle backslashes [shellcheck]
     12 shellcheck reported issue in this script: SC2162:info:5:11: read without -r will mangle backslashes [shellcheck]
      3 shellcheck reported issue in this script: SC2162:info:5:7: read without -r will mangle backslashes [shellcheck]
      1 shellcheck reported issue in this script: SC2162:info:6:15: read without -r will mangle backslashes [shellcheck]

@CvH
Copy link
Member

CvH commented Feb 7, 2024

also we need to look at allowing nightly and scripts in the actionslint config.

i guess that problem ? reviewdog/action-actionlint#76

@heitbaum
Copy link
Collaborator Author

heitbaum commented Feb 7, 2024

also we need to look at allowing nightly and scripts in the actionslint config.

i guess that problem ? reviewdog/action-actionlint#76

The proposed looks ok. In our case a hardcoded .github/actionlint.yaml “should” work - so we should only need the with: line?

@CvH
Copy link
Member

CvH commented Feb 27, 2024

sorry missed that pr :)

what do you think if we add a var$ for the LE version instead of hardcoding it at the template ?
So the templates would stay identical with just a single variable changed. Also easier to maintain if the whole workflow is identical. Spoiler warning, not tested if this actually works :)

So we could use

env:
  LE_VERSION: LE12

instead of
uses: ./.github/workflows/yml-uses-create-addon-LE10.yml

using
uses: ./.github/workflows/yml-uses-create-addon-$LE_VERSION.yml

@heitbaum
Copy link
Collaborator Author

sorry missed that pr :)

what do you think if we add a var$ for the LE version instead of hardcoding it at the template ? So the templates would stay identical with just a single variable changed. Also easier to maintain if the whole workflow is identical. Spoiler warning, not tested if this actually works :)

So we could use

env:
  LE_VERSION: LE12

instead of uses: ./.github/workflows/yml-uses-create-addon-LE10.yml

using uses: ./.github/workflows/yml-uses-create-addon-$LE_VERSION.yml

let me bench test it ...

@heitbaum
Copy link
Collaborator Author

uses:

no such use case ... ---> except for the id and uses keys
https://docs.github.com/en/actions/learn-github-actions/contexts

You can retrieve the values of variables stored in env context and use these values in your workflow file. 
You can use the env context in any key in a workflow step except for the id and uses keys. 
For more information on the step syntax, see 
"[Workflow syntax for GitHub Actions]
(https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps)."

@CvH CvH merged commit 90bf99a into LibreELEC:main May 1, 2024
1 check failed
@heitbaum heitbaum deleted the refactor branch May 2, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants