-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (65 loc) · 2.15 KB
/
smoke-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 .