-
Notifications
You must be signed in to change notification settings - Fork 11
86 lines (80 loc) · 2.92 KB
/
Copy pathtest.yml
File metadata and controls
86 lines (80 loc) · 2.92 KB
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
77
78
79
80
81
82
83
84
85
86
name: Test scripts
on:
push:
pull_request:
jobs:
structure:
name: Structure of every script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install PyYAML
run: pip install pyyaml
- name: Check format, uniqueness and shell syntax
run: python3 ci/check_structure.py
discover:
name: Find runnable service scripts
runs-on: ubuntu-latest
needs: structure
outputs:
services: ${{ steps.list.outputs.services }}
steps:
- uses: actions/checkout@v4
- id: list
# Only Docker service scripts are safe to run on a shared runner.
run: |
services=$(for d in scripts/*/; do
name=$(basename "$d")
grep -q -- '--name wslm-' "$d/script.noshell" && echo "$name"
done | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "services=$services" >> "$GITHUB_OUTPUT"
echo "Runnable services: $services"
service-works:
name: ${{ matrix.script }} works
runs-on: ubuntu-latest
needs: discover
strategy:
fail-fast: false
matrix:
script: ${{ fromJson(needs.discover.outputs.services) }}
steps:
- uses: actions/checkout@v4
- name: Run the script and probe its service
run: ci/run_service_test.sh "${{ matrix.script }}"
runner-linux:
name: ${{ matrix.script }} on ${{ matrix.image }}
runs-on: ubuntu-latest
needs: structure
strategy:
fail-fast: false
matrix:
script: [github-runner, gitlab-runner]
# Alpine included on purpose: github-runner has to refuse it.
image: ['debian:stable-slim', 'ubuntu:24.04', 'fedora:latest', 'archlinux:latest', 'alpine:latest']
steps:
- uses: actions/checkout@v4
# A fresh container stands in for a fresh WSL distro. Nothing gets
# registered: the script only meets a made-up token. GITHUB_TOKEN goes
# in because github-runner asks api.github.com for the latest release,
# and the 60-an-hour unauthenticated budget is shared with every other
# job on this runner's IP address.
- name: Install, re-run, and reject a made-up token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: docker run --rm -e GITHUB_TOKEN -v "$PWD:/repo:ro" "${{ matrix.image }}" sh /repo/ci/run_runner_test.sh "${{ matrix.script }}"
runner-macos:
name: ${{ matrix.script }} on macOS
runs-on: macos-latest
needs: structure
strategy:
fail-fast: false
matrix:
script: [github-runner-macos, gitlab-runner-macos]
steps:
- uses: actions/checkout@v4
# The macOS runners share a far smaller pool of IP addresses than the
# Linux ones, so the unauthenticated rate limit is reliably gone here.
- name: Install, re-run, and reject a made-up token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sh ci/run_runner_test.sh "${{ matrix.script }}"