test GitHub Actions artifact store #1
Workflow file for this run
This file contains 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
on: | ||
workflow_call: | ||
inputs: | ||
build_type: | ||
required: true | ||
type: string | ||
branch: | ||
type: string | ||
date: | ||
type: string | ||
sha: | ||
type: string | ||
repo: | ||
type: string | ||
node_type: | ||
type: string | ||
default: "cpu8" | ||
build_script: | ||
type: string | ||
default: "ci/build_cpp.sh" | ||
matrix_filter: | ||
type: string | ||
default: "." | ||
defaults: | ||
run: | ||
shell: bash | ||
permissions: | ||
actions: read | ||
checks: none | ||
contents: read | ||
deployments: none | ||
discussions: none | ||
id-token: write | ||
issues: none | ||
packages: read | ||
pages: none | ||
pull-requests: read | ||
repository-projects: none | ||
security-events: none | ||
statuses: none | ||
jobs: | ||
compute-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} | ||
steps: | ||
- name: Compute Build Matrix | ||
id: compute-matrix | ||
run: | | ||
set -eo pipefail | ||
export MATRIX=" | ||
- { CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu22.04', ARCH: 'amd64', PY_VER: '3.10' } | ||
" | ||
echo "MATRIX=$( | ||
yq -n -o json 'env(MATRIX)' | \ | ||
jq -c '${{ inputs.matrix_filter }} | {include: .}' \ | ||
)" | tee --append "${GITHUB_OUTPUT}" | ||
build: | ||
needs: compute-matrix | ||
timeout-minutes: 480 | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} | ||
runs-on: "linux-${{ matrix.ARCH }}-${{ inputs.node_type }}" | ||
env: | ||
RAPIDS_ARTIFACTS_DIR: ${{ github.workspace }}/artifacts | ||
container: | ||
image: rapidsai/ci-conda:cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }} | ||
env: | ||
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} | ||
PARALLEL_LEVEL: ${{ env.PARALLEL_LEVEL }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ inputs.repo }} | ||
ref: ${{ inputs.sha }} | ||
fetch-depth: 0 | ||
- name: Standardize repository information | ||
run: | | ||
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}" | ||
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}" | ||
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}" | ||
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}" | ||
# "cpp-build" prefix is necessary because all jobs get bundled as part of one workflow called e.g. "build" or "pr" | ||
echo "RAPIDS_ARTIFACT_PREFIX=cpp-build-${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-${{ matrix.ARCH }}-${{ matrix.PY_VER }}" >> "${GITHUB_ENV}" | ||
- name: C++ build | ||
run: ${{ inputs.build_script }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: (testing) generate artifacts | ||
run: | | ||
TEST_DIR="${{ github.workspace }}/test-artifacts" | ||
echo "TEST_DIR=${TEST_DIR}" >> "${GITHUB_ENV}" | ||
mkdir -p "${TEST_DIR}" | ||
head -c 1000000 /dev/urandom > "${TEST_DIR}/1mb.bin" | ||
head -c 10000000 /dev/urandom > "${TEST_DIR}/10mb.bin" | ||
head -c 100000000 /dev/urandom > "${TEST_DIR}/100mb.bin" | ||
head -c 1000000000 /dev/urandom > "${TEST_DIR}/1gb.bin" | ||
head -c 10000000000 /dev/urandom > "${TEST_DIR}/10gb.bin" | ||
- name: (testing) upload 1MB artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "${{ env.TEST_DIR }}/1mb.bin" | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-1mb" | ||
retention-days: 1 | ||
- name: (testing) upload 10MB artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "${{ env.TEST_DIR }}/10mb.bin" | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-10mb" | ||
retention-days: 1 | ||
- name: (testing) upload 100MB artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "${{ env.TEST_DIR }}/100mb.bin" | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-100mb" | ||
retention-days: 1 | ||
- name: (testing) upload 1GB artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "${{ env.TEST_DIR }}/1gb.bin" | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-1gb" | ||
retention-days: 1 | ||
- name: (testing) upload 10GB artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "${{ env.TEST_DIR }}/10gb.bin" | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-10gb" | ||
retention-days: 1 | ||
- name: (testing) upload bundle of test artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: "${{ env.TEST_DIR }}/*.bin" | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-bundle" | ||
retention-days: 1 | ||
- name: (testing) Upload real build artifacts | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}" | ||
path: "${{ env.RAPIDS_ARTIFACTS_DIR }}"/ | ||
retention-days: 1 |