awk post-processing #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [ pull_request, push ] | |
name: ci | |
jobs: | |
check-pr: | |
name: validate commits | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- run: git fetch origin master | |
- uses: flux-framework/pr-validator@master | |
python-lint: | |
name: python linting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.6 | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: install linting and formatting deps | |
run: pip install -r scripts/requirements-dev.txt | |
- name: format and linting checks | |
run: pre-commit run --all-files | |
check-sched: | |
needs: [python-lint] | |
name: flux-sched check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- run: git fetch --tags || true | |
- run: > | |
src/test/docker/docker-run-checks.sh --install-only | |
--tag=fluxrm/flux-core:bionic | |
- run: > | |
cd .. && | |
git clone https://github.com/flux-framework/flux-sched && | |
cd flux-sched && | |
src/test/docker/docker-run-checks.sh -j 4 -i bionic | |
check-accounting: | |
needs: [python-lint] | |
name: flux-accounting check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- run: > | |
src/test/docker/docker-run-checks.sh --image=el8 --install-only | |
--tag=fluxrm/flux-core:el8 | |
- run: > | |
cd .. && | |
git clone https://github.com/flux-framework/flux-accounting && | |
cd flux-accounting && | |
src/test/docker/docker-run-checks.sh -j 4 | |
generate-matrix: | |
# https://stackoverflow.com/questions/59977364 | |
name: Generate build matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- id: set-matrix | |
run: echo "::set-output name=matrix::$(src/test/generate-matrix.py)" | |
- run: src/test/generate-matrix.py | jq -S . | |
- run: echo "::set-output name=GITHUB_BRANCH::${GITHUB_REF#refs/heads}" | |
- run: echo "::set-output name=GITHUB_TAG::${GITHUB_REF#refs/tags}" | |
- run: echo "::set-output name=EVENT_NAME::${{github.event_name}}" | |
ci-checks: | |
needs: [ generate-matrix ] | |
runs-on: ubuntu-latest | |
env: | |
TAP_DRIVER_QUIET: 1 | |
FLUX_TEST_TIMEOUT: 300 | |
DOCKER_REPO: fluxrm/flux-core | |
DOCKER_USERNAME: travisflux | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_TRAVISFLUX_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
timeout-minutes: 60 | |
strategy: | |
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} | |
fail-fast: false | |
name: ${{matrix.name}} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: fetch annotated tag | |
if: > | |
(matrix.create_release || matrix.docker_tag) && | |
github.ref != 'refs/heads/master' | |
run: | | |
# Ensure git-describe works on a tag. | |
# (checkout@v3 action may have left current tag as | |
# lightweight instead of annotated. See | |
# https://github.com/actions/checkout/issues/290) | |
# | |
echo github.ref == ${{ github.ref }} ; | |
git fetch -f origin ${{ github.ref }}:${{ github.ref }} ; | |
echo git describe now reports $(git describe --always) | |
- name: coverage setup | |
env: ${{matrix.env}} | |
if: matrix.coverage | |
run: | | |
# Use python3 coverage to match version in flux docker image | |
sudo apt update ; \ | |
sudo apt install -yy python3-pip ; \ | |
pip3 install --upgrade pip ; | |
pip3 install --upgrade --force-reinstall coverage ; | |
- name: s3 setup | |
env: ${{matrix.env}} | |
if: matrix.test_s3 | |
run: | | |
docker run -d -p 9000:9000 minio/minio server /data; \ | |
- name: generate dumpfile from most recent flux-core tag | |
if: (matrix.create_release != true) | |
run: | | |
src/test/create-kvs-dumpfile.sh -d /tmp/dumpfile && | |
if test -f /tmp/dumpfile/*.bz2; then | |
cp /tmp/dumpfile/*.tar.bz2 $(pwd)/t/job-manager/dumps/valid | |
fi | |
- name: docker buildx | |
uses: docker/setup-buildx-action@v2 | |
if: matrix.needs_buildx | |
- name: docker-run-checks | |
env: ${{matrix.env}} | |
run: ${{matrix.command}} | |
- name: annotate errors | |
if: failure() || cancelled() | |
env: ${{matrix.env}} | |
run: src/test/checks-annotate.sh | |
- name: coverage report | |
if: success() && matrix.coverage && matrix.image == 'bionic' | |
env: | |
DOCKER_REPO: | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: ci-basic | |
- name: docker deploy | |
if: success() && matrix.docker_tag | |
env: ${{matrix.env}} | |
run: src/test/docker-deploy.sh | |
# Prepare, create and deploy release on tag: | |
- name: prep release | |
id: prep_release | |
if: success() && matrix.create_release | |
env: ${{matrix.env}} | |
run: echo "::set-output name=tarball::$(echo flux-core*.tar.gz)" | |
- name: create release | |
id: create_release | |
if: | | |
success() | |
&& matrix.create_release | |
&& github.repository == 'flux-framework/flux-core' | |
env: ${{matrix.env}} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ matrix.tag }} | |
release_name: flux-core ${{ matrix.tag }} | |
prerelease: true | |
files: flux-core*.tar.gz | |
body: | | |
View [Release Notes](https://github.com/${{ github.repository }}/blob/${{ matrix.tag }}/NEWS.md) for flux-core ${{ matrix.tag }} |