Skip to content

Merge pull request #122 from nrbgt/gh-120-postmortem-038 #633

Merge pull request #122 from nrbgt/gh-120-postmortem-038

Merge pull request #122 from nrbgt/gh-120-postmortem-038 #633

Workflow file for this run

name: CI
on:
push:
branches:
- dev
- main
pull_request:
branches: ['*']
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
PYTHONIOENCODING: utf-8
PYTHONUNBUFFERED: '1'
PIP_DISABLE_PIP_VERSION_CHECK: 'True'
# until have mamabforge...
CONDA_EXE: mamba
# our stuff
SKIP_CONDA_PREFLIGHT: 1
CACHE_EPOCH: 16
ATEST_RETRIES: 2
jobs:
build:
runs-on: ${{ matrix.os }}-latest
env:
BUILDING_IN_CI: 1
strategy:
fail-fast: true
matrix:
os: [ubuntu]
py: ['3.11']
steps:
- name: git checkout
uses: actions/checkout@v3
- name: setup (python)
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
architecture: x64
- name: setup (node)
uses: actions/setup-node@v3
with:
node-version: '18'
- name: cache (pip)
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-build-${{ hashFiles('.github/requirements-build.txt') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-build-
- name: cache (node)
uses: actions/cache@v3
id: cache-node-modules
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-build-${{ hashFiles('yarn.lock') }}
- name: cache (yarn)
uses: actions/cache@v3
if: steps.cache-node-modules.outputs.cache-hit != 'true'
id: cache-yarn-packages
with:
path: build/.yarn-packages
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
${{ env.CACHE_EPOCH }}-yarn-
- name: setup (pip)
run: pip install -U pip wheel setuptools
- name: setup (pip build)
run: pip install -U -v -r .github/requirements-build.txt
- name: check (pip)
run: |
set -eux
mkdir -p build/pip
pip freeze | tee build/pip/dist.pip.freeze
pip check
- name: build
shell: bash -l {0}
run: |
doit build || doit build
- name: build
shell: bash -l {0}
run: |
doit preflight:release
- name: publish dists
uses: actions/upload-artifact@v3
with:
name: ipyforcegraph-${{ github.run_number }}-dist
path: ./dist
lint:
runs-on: ${{ matrix.os }}-latest
env:
TOTAL_COVERAGE: 1
CI: 0
strategy:
fail-fast: false
matrix:
os: [ubuntu]
steps:
- name: install apt dependencies (linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
set -eux
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libdbus-glib-1-2 \
libegl1 \
libgdk-pixbuf2.0-0 \
libgl1 \
libgles2 \
libgudev-1.0-0 \
libhyphen0 \
libnotify4 \
libopus0 \
libsecret-1-0 \
libwebpdemux2 \
libwoff1 \
libxslt1.1 \
libxt6 \
xvfb
- name: git checkout
uses: actions/checkout@v3
- name: cache (yarn)
uses: actions/cache@v3
with:
path: node_modules/
key: yarn-${{ runner.os }}-${{ hashFiles('yarn.lock', '.yarnrc') }}
- name: base env (conda)
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: .github/locks/linux-64_dev_lab3.6_py3.11.conda.lock
miniforge-variant: Mambaforge
use-mamba: true
- name: lint
shell: bash -l {0}
run: |
doit -n4 lint || doit lint || exit 1
- name: audit
shell: bash -l {0}
run: |
doit audit || exit 1
- name: build docs
shell: bash -l {0}
run: doit -n4 docs
- name: upload (docs)
uses: actions/upload-artifact@v3
with:
name: ipyforcegraph-${{ github.run_number }}-docs
path: |
./build/docs
- name: cache (docs)
uses: actions/cache@v3
with:
path: build/links
key: |
${{ env.CACHE_EPOCH }}-links-${{ runner.os }}-${{ hashFiles('.github/base-environment.yml') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-links-${{ runner.os }}-
${{ env.CACHE_EPOCH }}-links-
- name: docs
shell: bash -l {0}
run: doit -n4 checkdocs
- name: test (unit)
shell: bash -l {0}
run: |
doit pytest
- name: test (acceptance)
shell: bash -l {0}
run: |
xvfb-run --auto-servernum doit -n4 test || xvfb-run --auto-servernum doit test || exit 1
- name: report (coverage)
shell: bash -l {0}
run: |
doit -n8 coverage && doit -n8 coverage
- name: upload (coverage)
if: always()
uses: actions/upload-artifact@v3
with:
name: ipyforcegraph-${{ github.run_number }}-coverage
path: |
./build/reports
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
test:
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
py: ['py3.8', 'py3.11']
include:
- os: ubuntu
subdir: linux-64
- os: macos
subdir: osx-64
- os: windows
subdir: win-64
- py: 'py3.8'
artifact: sdist
lab: 'lab3.5'
- py: 'py3.11'
artifact: wheel
lab: 'lab3.6'
env:
INSTALL_ARTIFACT: ${{ matrix.artifact }}
TESTING_IN_CI: 1
IPYFORCEGRAPH_PY: ${{ matrix.py }}
IPYFORCEGRAPH_LAB: ${{ matrix.lab }}
steps:
- name: install apt dependencies (linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
set -eux
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libdbus-glib-1-2 \
libegl1 \
libgdk-pixbuf2.0-0 \
libgl1 \
libgles2 \
libgudev-1.0-0 \
libhyphen0 \
libnotify4 \
libopus0 \
libsecret-1-0 \
libwebpdemux2 \
libwoff1 \
libxslt1.1 \
libxt6 \
xvfb
- name: configure line endings
run: |
git config --global core.autocrlf false
- name: git checkout
uses: actions/checkout@v3
- name: env (conda)
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: |-
.github/locks/${{ matrix.subdir }}_test_${{ matrix.lab }}_${{ matrix.py }}.conda.lock
miniforge-variant: Mambaforge
use-mamba: true
- uses: actions/download-artifact@v3
with:
name: ipyforcegraph-${{ github.run_number }}-dist
path: ./dist
- name: preflight (linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
shell: bash -l {0}
run: doit -n4 preflight:lab || doit preflight:lab || exit 1
- name: preflight (macos)
if: ${{ contains(matrix.os, 'macos') }}
shell: bash -l {0}
run: doit -n4 preflight:lab || doit preflight:lab || exit 1
- name: preflight (windows)
if: ${{ contains(matrix.os, 'windows') }}
shell: cmd /C CALL {0}
env:
ATEST_PROCESSES: 1
WIN_CI: 1
run: |
doit -n4 preflight:lab || doit preflight:lab || exit 1
- name: test (linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
shell: bash -l {0}
run: |
xvfb-run --auto-servernum doit -n4 test || xvfb-run --auto-servernum doit test || exit 1
- name: test (macos)
if: ${{ contains(matrix.os, 'macos') }}
shell: bash -l {0}
run: doit -n4 test || doit test || exit 1
- name: test (windows)
if: ${{ contains(matrix.os, 'windows') }}
shell: cmd /C CALL {0}
env:
ATEST_PROCESSES: 1
WIN_CI: 1
run: doit test || doit test || exit 1
- name: reports
uses: actions/upload-artifact@v3
with:
name: |-
ipyforcegraph-${{ github.run_number }}-${{ job.status }}-reports-${{ matrix.os }}-${{ matrix.py }}-${{ matrix.lab }}
path: |
./build/reports
if: always()
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"