|
| 1 | +name: GitHub CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + schedule: |
| 7 | + - cron: 0 0 * * 0 |
| 8 | + |
| 9 | +defaults: |
| 10 | + run: |
| 11 | + shell: 'bash -Eeuo pipefail -x {0}' |
| 12 | + |
| 13 | +jobs: |
| 14 | + |
| 15 | + verify: |
| 16 | + name: Verify Binaries |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v1 |
| 20 | + - name: Update Binaries |
| 21 | + run: ./update.sh |
| 22 | + - name: Verify Changes |
| 23 | + run: | |
| 24 | + changes="$(git status --porcelain '**/hello' '**/nanoserver*/hello.txt')" |
| 25 | + test -z "$changes" |
| 26 | +
|
| 27 | + generate-jobs: |
| 28 | + needs: verify |
| 29 | + name: Generate Jobs |
| 30 | + runs-on: ubuntu-latest |
| 31 | + outputs: |
| 32 | + strategy: ${{ steps.generate-jobs.outputs.strategy }} |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v1 |
| 35 | + - id: generate-jobs |
| 36 | + name: Generate Jobs |
| 37 | + run: | |
| 38 | + git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew |
| 39 | + strategy="$(~/bashbrew/scripts/github-actions/generate.sh)" |
| 40 | + jq . <<<"$strategy" # sanity check / debugging aid |
| 41 | + echo "::set-output name=strategy::$strategy" |
| 42 | +
|
| 43 | + test: |
| 44 | + needs: generate-jobs |
| 45 | + strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} |
| 46 | + name: ${{ matrix.name }} |
| 47 | + runs-on: ${{ matrix.os }} |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v1 |
| 50 | + - name: Prepare Environment |
| 51 | + run: ${{ matrix.runs.prepare }} |
| 52 | + - name: Pull Dependencies |
| 53 | + run: ${{ matrix.runs.pull }} |
| 54 | + - name: Build ${{ matrix.name }} |
| 55 | + run: ${{ matrix.runs.build }} |
| 56 | + - name: History ${{ matrix.name }} |
| 57 | + run: ${{ matrix.runs.history }} |
| 58 | + - name: Test ${{ matrix.name }} |
| 59 | + run: ${{ matrix.runs.test }} |
| 60 | + - name: '"docker images"' |
| 61 | + run: ${{ matrix.runs.images }} |
0 commit comments