mirror of
https://github.com/clearlinux/official-images.git
synced 2026-09-05 13:11:44 +00:00
87 lines
2.8 KiB
YAML
87 lines
2.8 KiB
YAML
name: Test PR
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
defaults:
|
|
run:
|
|
shell: 'bash -Eeuo pipefail -x {0}'
|
|
|
|
env:
|
|
# https://github.com/docker-library/bashbrew/issues/10
|
|
GIT_LFS_SKIP_SMUDGE: 1
|
|
|
|
# cancel existing runs if user makes another push
|
|
concurrency:
|
|
group: ${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
|
|
naughty:
|
|
name: Naughty
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Check for Common Issues
|
|
run: |
|
|
git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew
|
|
~/bashbrew/bashbrew.sh --version > /dev/null
|
|
export PATH="$HOME/bashbrew/bin:$PATH"
|
|
bashbrew --version
|
|
.github/workflows/naughty.sh
|
|
|
|
generate-jobs:
|
|
name: Generate Jobs
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
strategy: ${{ steps.generate-jobs.outputs.strategy }}
|
|
length: ${{ steps.generate-jobs.outputs.length }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- id: generate-jobs
|
|
name: Generate Jobs
|
|
run: |
|
|
git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew
|
|
strategy="$(.github/workflows/generate.sh ~/bashbrew)"
|
|
jq . <<<"$strategy" # sanity check / debugging aid
|
|
echo "::set-output name=strategy::$strategy"
|
|
length="$(jq <<<"$strategy" -r '.matrix.include | length')"
|
|
echo "::set-output name=length::$length"
|
|
|
|
test:
|
|
needs: generate-jobs
|
|
strategy: ${{ fromJSON(needs.generate-jobs.outputs.strategy) }}
|
|
if: needs.generate-jobs.outputs.length > 0
|
|
name: ${{ matrix.name }}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Prepare Git
|
|
run: |
|
|
# enable symlinks on Windows (https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresymlinks)
|
|
git config --global core.symlinks true
|
|
# also, make sure Windows symlinks are *real* symlinks (https://github.com/git-for-windows/git/pull/156)
|
|
echo 'MSYS=winsymlinks:nativestrict' >> "$GITHUB_ENV"
|
|
# https://github.com/docker-library/bashbrew/blob/a40a54d4d81b9fd2e39b4d7ba3fe203e8b022a67/scripts/github-actions/generate.sh#L146-L149
|
|
if: runner.os == 'Windows'
|
|
- uses: actions/checkout@v2
|
|
- name: Prepare Environment
|
|
run: ${{ matrix.runs.prepare }}
|
|
- name: Pull Dependencies
|
|
run: ${{ matrix.runs.pull }}
|
|
- name: Build ${{ matrix.name }}
|
|
run: ${{ matrix.runs.build }}
|
|
- name: History ${{ matrix.name }}
|
|
run: ${{ matrix.runs.history }}
|
|
- name: Test ${{ matrix.name }}
|
|
run: ${{ matrix.runs.test }}
|
|
- name: '"docker images"'
|
|
run: ${{ matrix.runs.images }}
|