Automated devcontainer feature update #1023
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: "CI - Test Templates" | |
| on: | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ludeeus/[email protected] | |
| with: | |
| check_together: 'yes' | |
| env: | |
| SHELLCHECK_OPTS: -e SC1090 -e SC1091 | |
| detect-changes: | |
| name: "Detect changes" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| common_filters: | |
| - | |
| - '.github/workflows/test-pr.yaml' | |
| - '.github/actions/smoke-test/**' | |
| - 'startupscript/**' | |
| - 'test/**' | |
| config: | |
| - example: | |
| user: jovyan | |
| jupyter-template: | |
| user: jupyter | |
| r-analysis: | |
| user: rstudio | |
| workbench_tools: true | |
| postgres_client: true | |
| r-analysis-aou: | |
| user: rstudio | |
| workbench_tools: true | |
| postgres_client: true | |
| filters: | |
| - 'src/aou-common/**' | |
| vscode: | |
| user: abc | |
| workbench_tools: true | |
| postgres_client: true | |
| vscode-docker: | |
| user: abc | |
| workbench_tools: true | |
| workbench-jupyter: | |
| template: custom-workbench-jupyter-template | |
| user: jupyter | |
| maximize_build_space: true | |
| workbench_tools: true | |
| postgres_client: true | |
| options: | |
| containerImage: 'us-west2-docker.pkg.dev/shared-pub-buckets-94mvrf/workbench-artifacts/app-workbench-jupyter:ov-dev-stable' | |
| filters: | |
| - 'src/jupyter-common/**' | |
| jupyter-aou: | |
| user: jupyter | |
| maximize_build_space: true | |
| workbench_tools: true | |
| postgres_client: true | |
| filters: | |
| - 'src/jupyter-common/**' | |
| - 'src/aou-common/**' | |
| nemo_jupyter: | |
| user: jupyter | |
| maximize_build_space: true | |
| workbench_tools: true | |
| postgres_client: true | |
| nemo_jupyter_aou: | |
| user: jupyter | |
| maximize_build_space: true | |
| workbench_tools: true | |
| postgres_client: true | |
| filters: | |
| - 'src/aou-common/**' | |
| - 'src/nemo_jupyter/**' | |
| workbench-jupyter-parabricks: | |
| user: jupyter | |
| maximize_build_space: true | |
| workbench_tools: true | |
| postgres_client: true | |
| workbench-jupyter-parabricks-aou: | |
| user: jupyter | |
| maximize_build_space: true | |
| workbench_tools: true | |
| postgres_client: true | |
| filters: | |
| - 'src/aou-common/**' | |
| - 'src/workbench-jupyter-parabricks/**' | |
| ubuntu-example: | |
| user: vscode | |
| outputs: | |
| apps: ${{ steps.output.outputs.apps }} | |
| steps: | |
| - name: Build filters | |
| id: build-filters | |
| run: | | |
| CONFIG='${{ toJson(matrix.config) }}' | |
| COMMON='${{ toJson(matrix.common_filters) }}' | |
| echo "filters<<EOF" >> $GITHUB_OUTPUT | |
| jq -n \ | |
| --argjson config "$CONFIG" \ | |
| --argjson common "$COMMON" \ | |
| '[$config | |
| | to_entries | |
| | .[] | |
| | .value as $v | |
| | .value = $common | |
| | .value += ["src/" + ($v.template // .key) + "/**"] | |
| | .value += if $v.workbench_tools then ["features/src/workbench-tools/**"] else [] end | |
| | .value += if $v.postgres_client then ["features/src/postgres-client/**"] else [] end | |
| | .value += ($v.filters // []) | |
| ] | from_entries' | yq -P >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - uses: dorny/paths-filter@v2 | |
| id: filter | |
| with: | |
| list-files: json | |
| filters: ${{ steps.build-filters.outputs.filters }} | |
| - name: Output changed templates as JSON object | |
| id: output | |
| run: | | |
| CHANGED_TEMPLATES='${{ steps.filter.outputs.changes }}' | |
| CONFIG='${{ toJson(matrix.config) }}' | |
| # output to github output | |
| echo "apps<<EOF" >> $GITHUB_OUTPUT | |
| jq -n \ | |
| --argjson changed "$CHANGED_TEMPLATES" \ | |
| --argjson config "$CONFIG" \ | |
| '[$changed[] as $t | |
| | $config[$t] | |
| | select(. != null) | |
| | { | |
| template: (.template // $t), | |
| user, | |
| maximize_build_space: (.maximize_build_space // false), | |
| workbench_tools: (.workbench_tools // false), | |
| postgres_client: (.postgres_client // false), | |
| options: (.options // {}), | |
| } | |
| ]' >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| test: | |
| name: "Smoke test '${{ matrix.app.template }}'" | |
| needs: [detect-changes] | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| if : ${{ needs.detect-changes.outputs.apps != '[]' }} | |
| strategy: | |
| matrix: | |
| app: ${{ fromJSON(needs.detect-changes.outputs.apps) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Free up disk space by removing unnecessary files, if needed | |
| - name: Maximize build disk space | |
| if: ${{ matrix.app.maximize_build_space }} | |
| uses: easimon/maximize-build-space@v10 | |
| with: | |
| # This is the amount of space left over, not allocated to the LVM | |
| # volume. We already checked out the repo so we don't need much | |
| root-reserve-mb: 512 | |
| build-mount-path: /mnt/build | |
| remove-dotnet: true | |
| remove-android: true | |
| remove-haskell: true | |
| remove-codeql: true | |
| remove-docker-images: true | |
| - name: Reconfigure docker and containerd to use new build space | |
| if: ${{ matrix.app.maximize_build_space }} | |
| run: | | |
| sudo mkdir -p /mnt/build/docker | |
| echo '{"data-root": "/mnt/build/docker"}' | sudo tee /etc/docker/daemon.json | |
| sudo mkdir -p /mnt/build/containerd | |
| sudo containerd config default | sudo tee /etc/containerd/config.toml > /dev/null | |
| sudo sed -i "s|root = '/var/lib/containerd'|root = '/mnt/build/containerd'|" /etc/containerd/config.toml | |
| - name: Restart docker and containerd | |
| if: ${{ matrix.app.maximize_build_space }} | |
| run: | | |
| sudo systemctl restart containerd | |
| sudo systemctl restart docker | |
| - name: Smoke test for '${{ matrix.app.template }}' | |
| id: smoke_test | |
| uses: ./.github/actions/smoke-test | |
| with: | |
| template: "${{ matrix.app.template }}" | |
| user: "${{ matrix.app.user }}" | |
| workbench_tools: "${{ matrix.app.workbench_tools }}" | |
| postgres_client: "${{ matrix.app.postgres_client }}" | |
| options: "${{ toJSON(matrix.app.options) }}" |