Skip to content

Dev 221 djlabhub chain breaker #25

Dev 221 djlabhub chain breaker

Dev 221 djlabhub chain breaker #25

Workflow file for this run

name: Development
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: alpine
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
py_ver: 3.9
platform: linux/amd64
- distro: alpine
py_ver: 3.8
platform: linux/amd64
- distro: alpine
py_ver: 3.7
platform: linux/amd64
- distro: debian
py_ver: '3.10'
platform: linux/amd64
- distro: debian
py_ver: 3.9
platform: linux/amd64
- distro: debian
py_ver: 3.8
platform: linux/amd64
- distro: debian
py_ver: 3.7
platform: linux/amd64
# - distro: debian
# py_ver: 3.9
# platform: linux/arm64
# - distro: debian
# py_ver: 3.8
# platform: linux/arm64
# - distro: debian
# py_ver: 3.7
# platform: linux/arm64
env:
DISTRO: ${{matrix.distro}}
PY_VER: ${{matrix.py_ver}}
PLATFORM: ${{matrix.platform}}
JUPYTERHUB_VER: '1.4.2'
DOCKER_CLIENT_TIMEOUT: "120"
COMPOSE_HTTP_TIMEOUT: "120"
BASE_IMAGE_HASH: "8121b5d"
steps:
- uses: actions/checkout@v2
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- uses: dbhi/qus/action@main
with:
targets: aarch64
- name: Compile image
run: |
docker buildx bake -f dist/${DISTRO}/docker-compose.yaml \
--set *.platform=${PLATFORM} --set *.context=. --load
REF=$(eval "echo $(cat dist/${DISTRO}/docker-compose.yaml | grep 'image:' | \
awk '{print $2}')")
docker save "${REF}" | \
gzip > "${JUPYTERHUB_VER}-py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
- name: Add image artifact
uses: actions/upload-artifact@v2
with:
name: >
${{format('{0}-py{1}-{2}-{3}', env.JUPYTERHUB_VER, matrix.py_ver, matrix.distro,
env.PLATFORM_TAG)}}
path: >
${{format('{0}-py{1}-{2}-{3}.tar.gz', env.JUPYTERHUB_VER, matrix.py_ver,
matrix.distro, env.PLATFORM_TAG)}}
retention-days: 1
test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: alpine
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
py_ver: 3.9
platform: linux/amd64
- distro: alpine
py_ver: 3.8
platform: linux/amd64
- distro: alpine
py_ver: 3.7
platform: linux/amd64
- distro: debian
py_ver: '3.10'
platform: linux/amd64
- distro: debian
py_ver: 3.9
platform: linux/amd64
- distro: debian
py_ver: 3.8
platform: linux/amd64
- distro: debian
py_ver: 3.7
platform: linux/amd64
# - distro: debian
# py_ver: 3.9
# platform: linux/arm64
# - distro: debian
# py_ver: 3.8
# platform: linux/arm64
# - distro: debian
# py_ver: 3.7
# platform: linux/arm64
env:
DISTRO: ${{matrix.distro}}
PY_VER: ${{matrix.py_ver}}
JUPYTERHUB_VER: '1.4.2'
PLATFORM: ${{matrix.platform}}
steps:
- uses: actions/checkout@v2
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- name: Fetch image artifact
uses: actions/download-artifact@v2
with:
name: >
${{format('{0}-py{1}-{2}-{3}', env.JUPYTERHUB_VER, matrix.py_ver, matrix.distro,
env.PLATFORM_TAG)}}
- uses: dbhi/qus/action@main
with:
targets: aarch64
- name: Run integration tests
run: |
docker load < "${JUPYTERHUB_VER}-py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
tests/main.sh
publish:
if: github.event_name == 'push'&&
github.ref == 'refs/heads/master' &&
(
github.repository_owner == 'datajoint' ||
github.repository_owner == 'datajoint-company'
)
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: alpine
py_ver: '3.10'
platform: linux/amd64
- distro: alpine
py_ver: 3.9
platform: linux/amd64
- distro: alpine
py_ver: 3.8
platform: linux/amd64
- distro: alpine
py_ver: 3.7
platform: linux/amd64
- distro: debian
py_ver: '3.10'
platform: linux/amd64
- distro: debian
py_ver: 3.9
platform: linux/amd64
- distro: debian
py_ver: 3.8
platform: linux/amd64
- distro: debian
py_ver: 3.7
platform: linux/amd64
# - distro: debian
# py_ver: 3.9
# platform: linux/arm64
# - distro: debian
# py_ver: 3.8
# platform: linux/arm64
# - distro: debian
# py_ver: 3.7
# platform: linux/arm64
env:
DISTRO: ${{matrix.distro}}
PY_VER: ${{matrix.py_ver}}
JUPYTERHUB_VER: '1.4.2'
PLATFORM: ${{matrix.platform}}
DOCKER_USERNAME: ${{secrets.docker_username}}
DOCKER_PASSWORD: ${{secrets.docker_password}}
steps:
- uses: actions/checkout@v2
- name: Determine platform tag
run: |
PLATFORM_TAG=$(echo "$PLATFORM" | tr '/' '_')
echo "PLATFORM_TAG=${PLATFORM_TAG}" >> $GITHUB_ENV
- name: Fetch image artifact
uses: actions/download-artifact@v2
with:
name: >
${{format('{0}-py{1}-{2}-{3}', env.JUPYTERHUB_VER, matrix.py_ver, matrix.distro,
env.PLATFORM_TAG)}}
- name: Publish image
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker load < "${JUPYTERHUB_VER}-py${PY_VER}-${DISTRO}-${PLATFORM_TAG}.tar.gz"
REF=$(eval "echo $(cat dist/${DISTRO}/docker-compose.yaml | grep 'image:' | \
awk '{print $2}')")
TAG=$(echo $REF | awk -F':' '{print $2}')
IMAGE=$(echo $REF | awk -F':' '{print $1}')
docker push "${IMAGE}:${TAG}"
docker tag "${IMAGE}:${TAG}" "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
docker push "${IMAGE}:${TAG}-${GITHUB_SHA:0:7}"
[ "$PY_VER" == "3.9" ] && [ "$DISTRO" == "debian" ] \
&& docker tag "${IMAGE}:${TAG}" "${IMAGE}:latest" \
&& docker push "${IMAGE}:latest" \
|| echo "skipping 'latest' tag..."
publish-docs:
if: github.event_name == 'push'&&
github.ref == 'refs/heads/master' &&
(
github.repository_owner == 'datajoint' ||
github.repository_owner == 'datajoint-company'
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docs
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
# - name: Upload docs artifact
# uses: actions/upload-artifact@v1
# with:
# name: docs-html
# path: docs/_build/html/
# retention-days: 1
- name: Commit documentation changes
run: |
git clone https://github.com/${GITHUB_REPOSITORY}.git \
--branch gh-pages --single-branch gh-pages
rm -R gh-pages/*
cp -r docs/_build/html/* gh-pages/
cp .gitignore gh-pages/
touch gh-pages/.nojekyll
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add . --all
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{secrets.GITHUB_TOKEN}}