-
Notifications
You must be signed in to change notification settings - Fork 0
ci: call the shared reusable R-CMD-check workflow #84
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
Open
seonghobae
wants to merge
4
commits into
develop
Choose a base branch
from
feat/r-cmd-check-thin-caller
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
72a63e3
ci: call the shared reusable R-CMD-check workflow
seonghobae d1a2b89
fix(ci): match the reusable workflow's renamed pre-check inputs
seonghobae ff16c9a
ci: pin reusable R package check workflow
seonghobae db093e1
ci: bound reusable workflow permissions
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,62 +1,35 @@ | ||
| # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
| # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
| # | ||
| # Thin caller: shared R-CMD-check logic lives in the org-wide reusable | ||
| # workflow. See ContextualWisdomLab/.github#1716, | ||
| # ContextualWisdomLab/.github's docs/adr/0023-r-cmd-check-reusable-workflow-consolidation.md | ||
| # and docs/doctoring/r-cmd-check-reusable-workflow-consolidation.md. | ||
| name: R-CMD-check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master, develop] | ||
| pull_request: | ||
| branches: [main, master, develop] | ||
|
|
||
| name: R-CMD-check | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| R-CMD-check: | ||
| runs-on: ${{ matrix.config.os }} | ||
|
|
||
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| config: | ||
| - {os: macos-latest, r: 'release'} | ||
| - {os: windows-latest, r: 'release'} | ||
| - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
| - {os: ubuntu-latest, r: 'release'} | ||
| - {os: ubuntu-latest, r: 'oldrel-1'} | ||
|
|
||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| R_KEEP_PKG_SOURCE: yes | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - uses: r-lib/actions/setup-pandoc@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2 | ||
|
|
||
| - uses: r-lib/actions/setup-r@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2 | ||
| with: | ||
| r-version: ${{ matrix.config.r }} | ||
| http-user-agent: ${{ matrix.config.http-user-agent }} | ||
| use-public-rspm: true | ||
|
|
||
| - uses: r-lib/actions/setup-r-dependencies@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2 | ||
| with: | ||
| extra-packages: | | ||
| any::rcmdcheck | ||
| any::testthat | ||
| needs: check | ||
|
|
||
| - name: Run Zh formula regression tests | ||
| run: | | ||
| Rscript -e 'install.packages(".", repos = NULL, type = "source")' | ||
| Rscript -e 'library(kaefa); testthat::test_file("tests/testthat/test-zh-misfit-decision-rule.R")' | ||
|
|
||
| - uses: r-lib/actions/check-r-package@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2 | ||
| with: | ||
| error-on: '"error"' | ||
| upload-snapshots: true | ||
| args: 'c("--no-manual", "--no-tests")' | ||
| build_args: 'c("--no-manual")' | ||
| uses: ContextualWisdomLab/.github/.github/workflows/r-package-check.yml@816e3e4970fde4450585de2a7b8df7e2c5f82fe4 | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| r_matrix: | | ||
| [ | ||
| {"os": "macos-latest", "r": "release"}, | ||
| {"os": "windows-latest", "r": "release"}, | ||
| {"os": "ubuntu-latest", "r": "devel", "http-user-agent": "release"}, | ||
| {"os": "ubuntu-latest", "r": "release"}, | ||
| {"os": "ubuntu-latest", "r": "oldrel-1"} | ||
| ] | ||
| extra_packages: | | ||
| any::rcmdcheck | ||
| any::testthat | ||
| check_args: 'c("--no-manual", "--no-tests")' | ||
| install_package_before_pre_check: true | ||
| pre_check_test_file: tests/testthat/test-zh-misfit-decision-rule.R | ||
|
seonghobae marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: ContextualWisdomLab/kaefa
Length of output: 8943
🏁 Script executed:
Repository: ContextualWisdomLab/kaefa
Length of output: 18897
🌐 Web query:
GitHub Actions reusable workflow status check name caller job called workflow job name matrix💡 Result:
In GitHub Actions, the status check name for a job is determined by the
nameproperty of the job defined in your YAML file [1][2]. When using a reusable workflow, the caller workflow is responsible for the job definition, and consequently, the status check name [3][4]. Key considerations for status checks with reusable workflows and matrices: 1. Job Name and Status Checks: The status check name is derived from thejobs.<job_id>.namefield [1]. If thenamefield is not specified, it defaults to thejob_id[2]. When you call a reusable workflow within a job that uses a matrix strategy, GitHub creates a separate status check for each matrix combination [3]. Each of these generated jobs will have a status check name based on the job name pattern; you can use matrix variables in thenamefield to create unique status check names for each matrix run [3][2]. 2. Required Status Checks: A common issue is that required status checks may fail to pass if the naming of the job in the caller workflow does not exactly match the name defined in your branch protection rules [5][6]. Because reusable workflows are executed as part of the caller's job, ensuring consistency in the job name is critical [4][5]. 3. Context Limitations: You cannot natively access the full computed name of a job (including matrix values) from within the job itself using a simple context variable likegithub.job[2]. Thegithub.jobcontext only returns thejob_id[2]. To use the job name within your steps (e.g., for reporting or logging), a common workaround is to define the name using matrix variables in thenameproperty and manually store that value in an environment variable or output if needed [2]. 4. Identifying Calls: If you are experiencing difficulty with status checks, ensure that the caller workflow job correctly references the reusable workflow using theuseskeyword [3]. For complex scenarios where you need to track individual matrix statuses for reporting, users often save the result of the reusable workflow to an artifact and use a secondary, non-matrix job to aggregate those results [7]. In summary, the status check name is determined by thenameproperty in the caller workflow's job definition. Use${{ matrix.variable }}syntax within thatnameproperty to distinguish status checks across a matrix strategy [3][2].Citations:
🏁 Script executed:
Repository: ContextualWisdomLab/kaefa
Length of output: 866
필수 상태 검사 이름을 갱신하십시오.
현재 workflow는
R-CMD-check / ubuntu-latest (release)등 matrix별 이름을 게시합니다. 기존 필수 상태 검사R-CMD-check와 다르면 branch protection이 병합을 차단할 수 있습니다. branch protection의 필수 상태 검사 이름을 새 이름과 일치시키십시오.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 17-34: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: MCP tools