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

[ci] use GitHub Actions to re-generate R configure #4140

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/r_configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: R generate configure

on:
repository_dispatch:
types: [gha_run_r_configure]

jobs:
r-configure:
name: r-configure
timeout-minutes: 60
runs-on: ubuntu-latest
container: "ubuntu:20.04"
steps:
- name: Install essential software before checkout
run: |
apt-get update
apt-get install --no-install-recommends -y \
ca-certificates \
git
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 5
submodules: true
repository: microsoft/LightGBM
ref: "refs/heads/${{ fromJSON(github.event.client_payload.pr_branch) }}"
token: ${{ secrets.WORKFLOW }}
persist-credentials: true
- name: Update configure
shell: bash
run: ./R-package/recreate-configure.sh || exit -1
- name: Push changes
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git add "./R-package/configure"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can tell your main OS is Windows because of your defensive use of quotes 😛

git commit --allow-empty -m "Auto-update configure"
git push
8 changes: 8 additions & 0 deletions .github/workflows/triggering_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ jobs:
"${{ github.event.issue.pull_request.url }}" \
"${{ github.event.comment.id }}" \
"gha_run_r_solaris"

- name: Trigger update R configure
if: github.event.comment.body == '/gha run r-configure'
run: |
$GITHUB_WORKSPACE/.ci/trigger_dispatch_run.sh \
"${{ github.event.issue.pull_request.url }}" \
"${{ github.event.comment.id }}" \
"gha_run_r_configure"
4 changes: 4 additions & 0 deletions R-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ At build time, `configure` will be run and used to create a file `Makevars`, usi

3. Edit `src/Makevars.in`.

Alternatively, GitHub Actions can re-generate this file for you. On a pull request (only on internal one, does not work for ones from forks), create a comment with this phrase:

> /gha run r-configure

**Configuring for Windows**

At build time, `configure.win` will be run and used to create a file `Makevars.win`, using `Makevars.win.in` as a template.
Expand Down