(ci): GH Actions to build an test prebuilt devcontainers #2
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: Prebuilt Dev Containers - Build & Smoke Test | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| paths: | |
| - '.devcontainer/**' | |
| - '.github/workflows/main.yml' | |
| pull_request: | |
| paths: | |
| - '.devcontainer/**' | |
| - '.github/workflows/main.yml' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| subFolder: | |
| - .devcontainer/auditor | |
| - .devcontainer/minimal | |
| - .devcontainer/legacy-theredguild | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Check devcontainer config exists | |
| id: check | |
| run: | | |
| if [ -f "${{ matrix.subFolder }}/devcontainer.json" ]; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| echo "Skipping: ${{ matrix.subFolder }}/devcontainer.json does not exist." | |
| fi | |
| - name: Build and run devcontainer | |
| if: steps.check.outputs.exists == 'true' | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| subFolder: ${{ matrix.subFolder }} | |
| configFile: ${{ matrix.subFolder }}/devcontainer.json | |
| runCmd: echo "Devcontainer OK in ${{ matrix.subFolder }}" && uname -a | |
| push: never | |