Skip to content

Commit

Permalink
[ci] use GitHub Actions to re-generate R configure (#4140)
Browse files Browse the repository at this point in the history
* use GitHub Actions to re-generate R configure

* Update R-package/README.md

Co-authored-by: James Lamb <[email protected]>

Co-authored-by: James Lamb <[email protected]>
  • Loading branch information
StrikerRUS and jameslamb authored Mar 31, 2021
1 parent 593aef3 commit 9388b2e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
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"
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

0 comments on commit 9388b2e

Please sign in to comment.