Skip to content

server proxy notification plugin #812

server proxy notification plugin

server proxy notification plugin #812

Workflow file for this run

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:
- jupyter-template:
user: jupyter
jupyter:
user: jovyan
r-analysis:
user: rstudio
workbench_tools: true
vscode:
user: abc
workbench_tools: true
workbench-jupyter:
template: custom-workbench-jupyter-template
user: jupyter
maximize_build_space: true
workbench_tools: true
options:
containerImage: 'us-west2-docker.pkg.dev/shared-pub-buckets-94mvrf/workbench-artifacts/app-workbench-jupyter:ov-dev-stable'
jupyter-aou:
user: jupyter
maximize_build_space: true
workbench_tools: true
filters:
- 'src/aou-common/**'
nemo_jupyter:
user: jupyter
maximize_build_space: true
workbench_tools: true
nemo_jupyter_aou:
user: jupyter
maximize_build_space: true
workbench_tools: true
filters:
- 'src/aou-common/**'
- 'src/nemo_jupyter/**'
workbench-jupyter-parabricks:
user: jupyter
maximize_build_space: true
workbench_tools: true
workbench-jupyter-parabricks-aou:
user: jupyter
maximize_build_space: true
workbench_tools: true
filters:
- 'src/aou-common/**'
- 'src/workbench-jupyter-parabricks/**'
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 += ($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),
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.templates != '[]' }}
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: /var/lib/docker
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true
- name: Restart docker
if: ${{ matrix.app.maximize_build_space }}
run: sudo service docker restart
- 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 }}"
options: "${{ toJSON(matrix.app.options) }}"