|
| 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 | + generate-jobs: |
| 16 | + name: Generate Jobs |
| 17 | + runs-on: ubuntu-latest |
| 18 | + outputs: |
| 19 | + strategy: ${{ steps.generate-jobs.outputs.strategy }} |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v1 |
| 22 | + - id: generate-jobs |
| 23 | + name: Generate Jobs |
| 24 | + run: | |
| 25 | + git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew |
| 26 | + strategy="$(~/bashbrew/scripts/github-actions/generate.sh)" |
| 27 | + # if we're FROM jessie, include a ulimit so apt-get isn't slow (https://bugs.launchpad.net/bugs/1332440) |
| 28 | + strategy="$(jq -c '.matrix.include = [ .matrix.include[] | if .meta.froms[] | test("jessie") then .runs.build |= gsub("docker build"; "docker build --ulimit nofile=1024:1024") else . end ]' <<<"$strategy")" |
| 29 | + jq . <<<"$strategy" # sanity check / debugging aid |
| 30 | + echo "::set-output name=strategy::$strategy" |
| 31 | +
|
| 32 | + test: |
| 33 | + needs: generate-jobs |
| 34 | + strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }} |
| 35 | + name: ${{ matrix.name }} |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v1 |
| 39 | + - name: Prepare Environment |
| 40 | + run: ${{ matrix.runs.prepare }} |
| 41 | + - name: Pull Dependencies |
| 42 | + run: ${{ matrix.runs.pull }} |
| 43 | + - name: Build ${{ matrix.name }} |
| 44 | + run: ${{ matrix.runs.build }} |
| 45 | + - name: History ${{ matrix.name }} |
| 46 | + run: ${{ matrix.runs.history }} |
| 47 | + - name: Test ${{ matrix.name }} |
| 48 | + run: ${{ matrix.runs.test }} |
| 49 | + - name: '"docker images"' |
| 50 | + run: ${{ matrix.runs.images }} |
0 commit comments