Update CI #420
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
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| env: | |
| AWS_REGION: us-east-1 | |
| AWS_RIS_PUB_BUCKET: smpte-ris-pub | |
| AWS_RIS_PUB_ROLE: arn:aws:iam::189079736792:role/role-gh-ris-pub | |
| RIS_PUB_PREFIX: https://ris-pub.smpte.org | |
| PYTHONPATH: src/main/python | |
| jobs: | |
| build: | |
| if: > | |
| github.repository_owner == 'SMPTE' && ( | |
| (github.event_name == 'push' && github.ref == 'refs/heads/main') | |
| || github.event_name == 'pull_request' | |
| || github.event_name == 'release' | |
| ) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: repo_basename | |
| run: echo "VALUE=${GITHUB_REPOSITORY#*/}" >> "$GITHUB_OUTPUT" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pipenv | |
| pipenv install --deploy --dev | |
| - name: Setup build directory | |
| run: mkdir -p build | |
| - name: Unit tests | |
| run: | | |
| pipenv run python -m unittest discover -v -s src/test/python | |
| - name: Generate opentrackio documentation | |
| run: | | |
| pipenv run python src/tools/python/make_opentrackio_documentation.py | |
| - name: Generate parameter documentation | |
| run: | | |
| pipenv run python src/tools/python/make_documentation.py > build/index.md | |
| - name: Generate HTML | |
| uses: BaileyJM02/[email protected] | |
| with: | |
| input_path: build/index.md | |
| output_dir: build/ | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ env.AWS_RIS_PUB_ROLE }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Create review copy at https://ris-pub.smpte.org/ | |
| if: github.event_name == 'pull_request' | |
| id: deployRISpub | |
| shell: bash | |
| run: | | |
| SNAP_PATH=${{ steps.repo_basename.outputs.VALUE }}/${GITHUB_SHA} | |
| aws s3 sync ./build/opentrackio s3://${{ env.AWS_RIS_PUB_BUCKET }}/${SNAP_PATH} | |
| echo "SNAP_PATH=$SNAP_PATH" >> $GITHUB_OUTPUT | |
| - name: Publish documentation at https://ris-pub.smpte.org/ | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| shell: bash | |
| run: | | |
| aws s3 sync ./build/opentrackio s3://${{ env.AWS_RIS_PUB_BUCKET }}/${{ steps.repo_basename.outputs.VALUE }} | |
| - uses: marocchino/sticky-pull-request-comment@v2 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| message: | | |
| [OpenTrackIO documentation](${{ env.RIS_PUB_PREFIX }}/${{ steps.repo_basename.outputs.VALUE }}/) |