AWS Codebuild for fVDB CI #42
This file contains hidden or 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
| # Copyright Contributors to the OpenVDB Project | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| # GitHub Actions workflow file | |
| # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
| name: fVDB Codebuild | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - 'CHANGES' | |
| - 'CODEOWNERS' | |
| - 'doc/**' | |
| - 'openvdb/**' | |
| - 'openvdb_cmd/**' | |
| - 'openvdb_ax/**' | |
| - 'openvdb_maya/**' | |
| - 'openvdb_houdini/**' | |
| - 'nanovdb/**' | |
| - 'pendingchanges/**' | |
| - '**.md' | |
| - 'fvdb/debug/**' | |
| - 'fvdb/docs/**' | |
| - 'fvdb/examples/**' | |
| - 'fvdb/notebooks/**' | |
| - 'fvdb/scripts/**' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Linux GPU (AWS CodeBuild) | |
| # --------------------------------------------------------------------------- | |
| linux_gpu: | |
| name: 'ci-openvdb 2024' | |
| # Don't run on forks | |
| if: github.repository == 'AcademySoftwareFoundation/openvdb' | |
| # GH-hosted VM. The build runs in CentOS 7 'container' hard-coded in | |
| # AWS CodeBuild project. | |
| # TODO: Add support for dynamic GH Action defined CodeBuild | |
| # container choice. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Verify AWS Credentials Set | |
| run: | | |
| if [ -z "${{ secrets.CODEBUILD_ID }}" ] || [ -z "${{ secrets.CODEBUILD_SECRET }}" ]; then | |
| echo "Error: AWS credentials secrets not properly configured" | |
| echo "Please ensure CODEBUILD_ID and CODEBUILD_SECRET are set in organization secrets" | |
| exit 1 | |
| fi | |
| echo "AWS credentials secrets are configured" | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.CODEBUILD_ID }} | |
| aws-secret-access-key: ${{ secrets.CODEBUILD_SECRET }} | |
| aws-region: us-west-2 | |
| - name: Verify AWS Authentication | |
| run: | | |
| echo "Testing AWS authentication..." | |
| aws sts get-caller-identity || { | |
| echo "Error: AWS authentication failed" | |
| exit 1 | |
| } | |
| echo "AWS authentication successful" | |
| - name: Run CodeBuild | |
| uses: aws-actions/aws-codebuild-run-build@v1 | |
| with: | |
| project-name: OpenVDB | |
| buildspec-override: ci/buildspec.yml |