|
| 1 | +name: build |
| 2 | + |
| 3 | +description: Build specified project |
| 4 | + |
| 5 | +inputs: |
| 6 | + build-type: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + description: One of ci / release |
| 10 | + target-device: |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + host-platform: |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + use-container: |
| 17 | + required: true |
| 18 | + type: boolean |
| 19 | + docker-image: |
| 20 | + type: string |
| 21 | + required: true |
| 22 | + upload-enabled: |
| 23 | + required: true |
| 24 | + type: boolean |
| 25 | + |
| 26 | +runs: |
| 27 | + using: composite |
| 28 | + steps: |
| 29 | + |
| 30 | +<% for package_id, package_info in packages.items() %> |
| 31 | + - name: Download <<package_info.repo>> (artifacts) |
| 32 | + uses: ./.github/actions/download-artifacts |
| 33 | + with: |
| 34 | + artifact-repo: "<<package_info.repo>>" |
| 35 | + artifact-name: "<<package_info.artifact_name | replace_placeholder('repo', package_info.repo) | replace_placeholder('git_tag', package_info.git_tag) >>" |
| 36 | + target-device: "${{ inputs.target-device }}" |
| 37 | + git_sha: "<<package_info.git_tag>>" |
| 38 | + host-platform: ${{ inputs.host-platform }} |
| 39 | + dest-dir: ${{ env.ARTIFACTS_DIR }} |
| 40 | + dependencies-workflow: <<package_info.artifact_workflow>> |
| 41 | +<% endfor %> |
| 42 | + |
| 43 | +<% if packages %> |
| 44 | + |
| 45 | + - name: Display structure of downloaded artifacts |
| 46 | + shell: bash --noprofile --norc -xeuo pipefail {0} |
| 47 | + run: | |
| 48 | + pwd |
| 49 | + ls -lahR ${{ env.ARTIFACTS_DIR }} |
| 50 | +<% endif %> |
| 51 | + |
| 52 | + - if: ${{ inputs.use-container }} |
| 53 | + name: Build (in container) |
| 54 | + shell: bash --noprofile --norc -xeuo pipefail {0} |
| 55 | + run: | |
| 56 | + |
| 57 | + docker run \ |
| 58 | + -e AWS_REGION \ |
| 59 | + -e AWS_SESSION_TOKEN \ |
| 60 | + -e AWS_ACCESS_KEY_ID \ |
| 61 | + -e AWS_SECRET_ACCESS_KEY \ |
| 62 | + -e GITHUB_TOKEN \ |
| 63 | + -e ARTIFACTS_DIR="$ARTIFACTS_DIR" \ |
| 64 | + -e UPLOAD_ENABLED="$UPLOAD_ENABLED" \ |
| 65 | + -e USE_CUDA="$USE_CUDA" \ |
| 66 | + -e REPO_DIR="$REPO_DIR" \ |
| 67 | + -e LEGATE_CORE_BUILD_MODE="$LEGATE_CORE_BUILD_MODE" \ |
| 68 | + -e PYTHON_VERSION="$PYTHON_VERSION" \ |
| 69 | + -v "${{ env.REPO_DIR }}:${{ env.REPO_DIR }}" \ |
| 70 | + -v "${{ env.ARTIFACTS_DIR }}:${{ env.ARTIFACTS_DIR }}" \ |
| 71 | + --rm "${{ inputs.docker-image }}" \ |
| 72 | + /bin/bash -c "${{ env.REPO_DIR }}/continuous_integration/scripts/entrypoint ${{ env.REPO_DIR }}/continuous_integration/scripts/build ${{ inputs.build-type}} ${{ inputs.target-device }}" |
| 73 | + |
| 74 | + - if: ${{ !inputs.use-container }} |
| 75 | + name: Build (without container) |
| 76 | + shell: bash --noprofile --norc -xeuo pipefail {0} |
| 77 | + run: | |
| 78 | + "${{ env.REPO_DIR }}/continuous_integration/scripts/entrypoint" "${{ env.REPO_DIR }}/continuous_integration/scripts/build" "${{ inputs.build-type}}" "${{ inputs.target-device }}" |
| 79 | + |
| 80 | + - name: Display structure of the artifacts folder (post build) |
| 81 | + shell: bash --noprofile --norc -xeuo pipefail {0} |
| 82 | + run: | |
| 83 | + sudo chown -R $(whoami) ${{ env.ARTIFACTS_DIR }} |
| 84 | + ls -lahR ${{ env.ARTIFACTS_DIR }} |
| 85 | + |
| 86 | + - name: Upload build artifacts |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: ${{ env.ARTIFACT_NAME }} |
| 90 | + path: ${{ env.ARTIFACTS_DIR }} |
0 commit comments