Test Build #5292
Workflow file for this run
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: Test Build | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| paths-ignore: | |
| - "docs/**" | |
| - "mkdocs.yml" | |
| pull_request: | |
| branches: | |
| - "master" | |
| workflow_dispatch: | |
| inputs: | |
| go-integration-tests: | |
| type: boolean | |
| required: true | |
| default: false | |
| env: | |
| BUILD_INCREMENT: 150 | |
| PIP_DISABLE_PIP_VERSION_CHECK: on | |
| PIP_DEFAULT_TIMEOUT: 10 | |
| PIP_PROGRESS_BAR: off | |
| jobs: | |
| compute-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.set-version.outputs.version }} | |
| steps: | |
| - id: set-version | |
| run: | | |
| echo "version=$((${{ github.run_number }} + ${{ env.BUILD_INCREMENT }}))" >> $GITHUB_OUTPUT | |
| build-artifacts: | |
| needs: [compute-version] | |
| uses: ./.github/workflows/build-artifacts.yml | |
| with: | |
| version: ${{ needs.compute-version.outputs.version }} | |
| staging: true | |
| go-integration-tests: ${{ github.event_name == 'workflow_dispatch' && inputs.go-integration-tests || true }} | |
| upload-artifacts: | |
| needs: [compute-version, build-artifacts] | |
| # Skip for PRs from forks, where AWS credentials are not available | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| steps: | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Install AWS | |
| run: uv tool install awscli | |
| - name: Download dstack-gateway | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dstack-gateway | |
| path: gateway | |
| - name: Upload dstack-gateway to S3 | |
| working-directory: gateway | |
| run: | | |
| pwd | |
| ls -a | |
| ls -a .. | |
| WHEEL=dstack_gateway-${{ needs.compute-version.outputs.version }}-py3-none-any.whl | |
| aws s3 cp $WHEEL "s3://dstack-gateway-downloads/stgn/$WHEEL" | |
| echo "${{ needs.compute-version.outputs.version }}" | aws s3 cp - "s3://dstack-gateway-downloads/stgn/latest-version" | |
| - name: Download dstack-runner | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: dstack-runner-* | |
| merge-multiple: true | |
| path: runner | |
| - name: Upload dstack-runner to S3 | |
| working-directory: runner | |
| run: | | |
| aws s3 cp . "s3://dstack-runner-downloads-stgn/${{ needs.compute-version.outputs.version }}/binaries/" --recursive --exclude "*" --include "dstack-*" --acl public-read | |
| aws s3 cp . "s3://dstack-runner-downloads-stgn/latest/binaries/" --recursive --exclude "*" --include "dstack-*" --acl public-read | |
| - name: Download JSON schemas | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: json-schemas | |
| path: json-schemas | |
| - name: Upload JSON schemas to S3 | |
| working-directory: json-schemas | |
| run: | | |
| aws s3 cp configuration.json "s3://dstack-runner-downloads-stgn/${{ needs.compute-version.outputs.version }}/schemas/configuration.json" --acl public-read | |
| aws s3 cp configuration.json "s3://dstack-runner-downloads-stgn/latest/schemas/configuration.json" --acl public-read | |
| aws s3 cp profiles.json "s3://dstack-runner-downloads-stgn/${{ needs.compute-version.outputs.version }}/schemas/profiles.json" --acl public-read | |
| aws s3 cp profiles.json "s3://dstack-runner-downloads-stgn/latest/schemas/profiles.json" --acl public-read | |
| - name: Set latest version in S3 | |
| run: | | |
| echo ${{ needs.compute-version.outputs.version }} | aws s3 cp - s3://get-dstack/stgn-cli/latest-version --acl public-read | |
| docs-build: | |
| # Skip for PRs from forks since mkdocs-material-insiders is not available in forks | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Install dstack | |
| run: | | |
| uv pip install examples/plugins/example_plugin_server | |
| uv pip install -e '.[server]' | |
| # Move these deps into an extra and install that way | |
| - name: Build | |
| run: | | |
| uv pip install pillow cairosvg | |
| sudo apt-get update && sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev | |
| uv pip install mkdocs-material "mkdocs-material[imaging]" mkdocs-material-extensions mkdocs-redirects mkdocs-gen-files "mkdocstrings[python]" mkdocs-render-swagger-plugin --upgrade | |
| uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git | |
| uv run mkdocs build -s |