|
1 | 1 | name: GitHub CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - |
5 | 4 | pull_request: |
6 | | - |
7 | 5 | push: |
8 | 6 | branches: |
9 | 7 | - master |
10 | | - |
11 | 8 | schedule: |
12 | 9 | - cron: 0 0 * * 0 |
13 | 10 |
|
14 | | -jobs: |
15 | | - |
16 | | - build-test: |
| 11 | +defaults: |
| 12 | + run: |
| 13 | + shell: 'bash -Eeuo pipefail -x {0}' |
17 | 14 |
|
18 | | - strategy: |
19 | | - matrix: |
20 | | - libc: |
21 | | - - glibc |
22 | | - - musl |
23 | | - - uclibc |
| 15 | +jobs: |
24 | 16 |
|
| 17 | + generate-jobs: |
| 18 | + name: Generate Jobs |
25 | 19 | runs-on: ubuntu-latest |
26 | | - |
| 20 | + outputs: |
| 21 | + strategy: ${{ steps.generate-jobs.outputs.strategy }} |
27 | 22 | steps: |
28 | | - |
29 | 23 | - uses: actions/checkout@v1 |
30 | | - with: |
31 | | - fetch-depth: 1 |
32 | | - |
33 | | - - name: Prepare Environment |
34 | | - run: docker system prune --all --force --volumes |
35 | | - - name: Happy Eyeballs |
36 | | - run: wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash |
37 | | - |
38 | | - - name: Build Tarball |
39 | | - run: ./build.sh ${{ matrix.libc }} |
40 | | - |
41 | | - - name: Build Image |
42 | | - run: docker build -t busybox:${{ matrix.libc }} ${{ matrix.libc }} |
43 | | - |
44 | | - - name: Run Tests |
| 24 | + - id: generate-jobs |
| 25 | + name: Generate Jobs |
45 | 26 | run: | |
46 | | - git clone --depth 1 https://github.com/docker-library/official-images.git ~/oi |
47 | | - ~/oi/test/run.sh busybox:${{ matrix.libc }} |
48 | | -
|
| 27 | + git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew |
| 28 | + strategy="$(GENERATE_STACKBREW_LIBRARY='.github/workflows/fake-gsl.sh' ~/bashbrew/scripts/github-actions/generate.sh)" |
| 29 | + strategy="$(jq -c '.matrix.include = [ .matrix.include[] | .runs.build = "./build.sh " + (.meta.entries[].directory | @sh) + "\n" + .runs.build ]' <<<"$strategy")" |
| 30 | + jq . <<<"$strategy" # sanity check / debugging aid |
| 31 | + echo "::set-output name=strategy::$strategy" |
| 32 | +
|
| 33 | + test: |
| 34 | + needs: generate-jobs |
| 35 | + strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} |
| 36 | + name: ${{ matrix.name }} |
| 37 | + runs-on: ${{ matrix.os }} |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v1 |
| 40 | + - name: Prepare Environment |
| 41 | + run: ${{ matrix.runs.prepare }} |
| 42 | + - name: Pull Dependencies |
| 43 | + run: ${{ matrix.runs.pull }} |
| 44 | + - name: Build ${{ matrix.name }} |
| 45 | + run: ${{ matrix.runs.build }} |
| 46 | + - name: History ${{ matrix.name }} |
| 47 | + run: ${{ matrix.runs.history }} |
| 48 | + - name: Test ${{ matrix.name }} |
| 49 | + run: ${{ matrix.runs.test }} |
49 | 50 | - name: '"docker images"' |
50 | | - run: docker images |
| 51 | + run: ${{ matrix.runs.images }} |
0 commit comments