Smoke tests #412
This file contains 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: Smoke tests | |
on: | |
push: | |
paths: | |
- 'features/src/**' | |
- 'test/**' | |
- '.github/workflows/smoke-tests.yml' | |
- '!**/README.md' | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
prepare: | |
name: Prepare list of tests | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Set matrix | |
id: set-matrix | |
working-directory: test | |
run: | | |
echo matrix="$(find . -name "devcontainer*.json" -exec basename {} \; | jq -R . | jq -sc)" >> "${GITHUB_OUTPUT}" | |
smoke-tests: | |
needs: prepare | |
name: ${{ matrix.file }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
file: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
permissions: | |
contents: read | |
packages: read | |
env: | |
BUILDKIT_PROGRESS: plain | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Copy features | |
working-directory: test | |
run: | | |
mkdir -p .devcontainer/features | |
rsync -a --delete ../features/src/* .devcontainer/features | |
sed -i 's!ghcr.io/automattic/vip-codespaces/!./.devcontainer/features/!' .devcontainer/features/*/devcontainer-feature.json | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Expose GitHub Runtime | |
uses: Automattic/vip-actions/expose-github-runtime@trunk | |
- name: Install @devcontainers/cli | |
run: npm install -g @devcontainers/cli | |
- name: Build images | |
working-directory: images/src | |
run: | | |
REPO="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" | |
for image in *; do | |
docker buildx build -t "ghcr.io/${REPO}/${image}:latest" --cache-from type=gha --cache-to type=gha,mode=max "./${image}" | |
done | |
- name: Build | |
working-directory: test | |
run: devcontainer build --config "${{ matrix.file }}" --workspace-folder . |