<bot> update dependencies*.log files(s) #2113
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
name: wipac ci/cd | |
on: [ push ] | |
env: | |
CI_TEST: 'yes' | |
THIS_IMAGE_WITH_TAG: 'ghcr.io/wipacrepo/skydriver:latest' | |
EWMS_PILOT_TASK_TIMEOUT: 999 | |
SCAN_BACKLOG_RUNNER_SHORT_DELAY: 1 | |
SCAN_BACKLOG_RUNNER_DELAY: 1 | |
SCAN_BACKLOG_PENDING_ENTRY_TTL_REVIVE: 200 | |
LOG_LEVEL: debug | |
jobs: | |
py-versions: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.versions.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: versions | |
uses: WIPACrepo/[email protected] | |
############################################################################# | |
# LINTERS | |
############################################################################# | |
flake8: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- uses: WIPACrepo/[email protected] | |
with: | |
max-complexity: 20 # decrease this to `10` in the future | |
mypy: | |
needs: [ py-versions ] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
py3: ${{ fromJSON(needs.py-versions.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.py3 }} | |
- uses: WIPACrepo/[email protected] | |
############################################################################# | |
# PACKAGING | |
############################################################################# | |
writable-branch-detect: | |
runs-on: ubuntu-latest | |
outputs: | |
OKAY: ${{ steps.detect.outputs.OKAY }} | |
steps: | |
- name: is this a bot-writable branch? | |
id: detect | |
# dependabot can't access normal secrets | |
# & don't run non-branch triggers (like tags) | |
# & we don't want to trigger an update on PR's merge to main/master/default (which is a branch) | |
run: | | |
if [[ \ | |
${{github.actor}} != 'dependabot[bot]' && \ | |
${{github.ref_type}} == 'branch' && \ | |
${{format('refs/heads/{0}', github.event.repository.default_branch)}} != ${{github.ref}} \ | |
]]; then | |
echo "OKAY=true" >> "$GITHUB_OUTPUT" | |
echo "yes, this branch is compatible" | |
else | |
echo "OKAY=false" >> "$GITHUB_OUTPUT" | |
echo "no, this branch is incompatible" | |
fi | |
py-setup: | |
needs: [ writable-branch-detect ] | |
runs-on: ubuntu-latest | |
steps: | |
- if: needs.writable-branch-detect.outputs.OKAY == 'true' | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- if: needs.writable-branch-detect.outputs.OKAY == 'true' | |
uses: WIPACrepo/[email protected] | |
with: | |
base-keywords: WIPAC IceCube | |
py-dependencies: | |
needs: [ writable-branch-detect ] | |
runs-on: ubuntu-latest | |
steps: | |
- if: needs.writable-branch-detect.outputs.OKAY == 'true' | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- if: needs.writable-branch-detect.outputs.OKAY == 'true' | |
uses: docker/setup-buildx-action@v2 | |
- if: needs.writable-branch-detect.outputs.OKAY == 'true' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile | |
tags: skydriver:py-dep-this | |
load: true | |
- if: needs.writable-branch-detect.outputs.OKAY == 'true' | |
uses: WIPACrepo/[email protected] | |
############################################################################# | |
# TESTS | |
############################################################################# | |
unit-tests: | |
needs: [ py-versions ] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
py3: ${{ fromJSON(needs.py-versions.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.py3 }} | |
- name: pip install | |
run: | | |
pip install --upgrade pip wheel setuptools | |
pip install .[tests] | |
- name: test | |
run: | | |
pytest -vvv tests/unit | |
- name: Dump logs | |
if: always() | |
run: | | |
cat pytest.logs || true | |
integration-tests: | |
needs: [ py-versions ] | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
py3: ${{ fromJSON(needs.py-versions.outputs.matrix) }} | |
services: | |
mongo: | |
image: bitnami/mongodb:4 | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/build-push-action@v3 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=min | |
file: Dockerfile | |
tags: wipac/skydriver:local | |
load: true | |
- name: test | |
run: | | |
export LATEST_TAG=$( \ | |
curl -I https://github.com/icecube/skymap_scanner/releases/latest \ | |
| awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}' \ | |
| sed 's/v//' \ | |
) | |
echo $LATEST_TAG # this tag may be off if there's a delay between GH release & docker hub | |
# make test script | |
DIR="test-script-dir" | |
mkdir $DIR | |
echo "#!/bin/bash" >> $DIR/test-script.sh | |
echo "set -xe" >> $DIR/test-script.sh | |
echo "pip install .[tests]" >> $DIR/test-script.sh | |
echo "python -m pytest -vvv tests/integration --exitfirst" >> $DIR/test-script.sh | |
chmod +x $DIR/test-script.sh | |
cat $DIR/test-script.sh | |
docker run --network="host" --rm -i --name test \ | |
--env LATEST_TAG=$LATEST_TAG \ | |
--env THIS_IMAGE_WITH_TAG=$THIS_IMAGE_WITH_TAG \ | |
$(env | grep '^SKYSCAN_' | awk '$0="--env "$0') \ | |
$(env | grep '^EWMS_' | awk '$0="--env "$0') \ | |
$(env | grep '^CLIENTMANAGER_' | awk '$0="--env "$0') \ | |
$(env | grep '^CI_' | awk '$0="--env "$0') \ | |
$(env | grep '^SCAN_' | awk '$0="--env "$0') \ | |
--mount type=bind,source=$(realpath $DIR),target=/local/$DIR \ | |
wipac/skydriver:local \ | |
/local/$DIR/test-script.sh | |
- name: dump test logs | |
if: always() | |
run: | | |
docker logs test || true | |
- name: dump mongo logs | |
if: always() | |
run: | | |
docker logs "${{ job.services.mongo.id }}" || true | |
test-build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile | |
tags: wipac/skydriver:local | |
release: | |
# only run on main/master/default | |
if: format('refs/heads/{0}', github.event.repository.default_branch) == github.ref | |
needs: [ flake8, mypy, py-setup, py-dependencies, unit-tests, integration-tests, test-build-docker ] | |
runs-on: ubuntu-latest | |
concurrency: release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Python Semantic Release | |
uses: python-semantic-release/[email protected] | |
with: | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
# repository_username: __token__ | |
# repository_password: ${{ secrets.PYPI_TOKEN }} |