Skip to content

R-package] [ci] work around {yaml} R-devel issues #23

R-package] [ci] work around {yaml} R-devel issues

R-package] [ci] work around {yaml} R-devel issues #23

Workflow file for this run

# builds core artifacts, intended to be attached to releases
# or used by other workflows
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# tell scripts where to put artifacts
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
jobs:
archive:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 5
persist-credentials: false
submodules: true
- name: Create source archive
run: |
mkdir -p "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
tar \
-czvf \
/tmp/LightGBM-complete_source_code_tar_gz.tar.gz \
.
mv \
/tmp/LightGBM-complete_source_code_tar_gz.tar.gz \
${BUILD_ARTIFACTSTAGINGDIRECTORY}/
- name: Create commit.txt
shell: bash
run: |
# for pull requests, github.sha refers to the merge commit from merging the PR and
# target branch... we want the actual commit that was pushed
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
COMMIT_SHA="${{ github.event.pull_request.head.sha }}"
else
COMMIT_SHA="${{ github.sha }}"
fi
echo "${COMMIT_SHA}" > "${BUILD_ARTIFACTSTAGINGDIRECTORY}/commit.txt"
- name: Upload artifacts
uses: actions/upload-artifact@v5
with:
name: source-archive
path: |
${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/commit.txt
${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/LightGBM-complete_source_code_tar_gz.tar.gz
if-no-files-found: error
all-build-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs:
- archive
steps:
- name: Note that all tests succeeded
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}