kopia lustrzana https://github.com/deathbeds/ipydrawio
414 wiersze
11 KiB
YAML
414 wiersze
11 KiB
YAML
# main continuous integration workflow
|
|
|
|
# Copyright 2022 ipydrawio contributors
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
concurrency:
|
|
group: ${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
PYTHONUNBUFFERED: '1'
|
|
PYTHONIOENCODING: 'utf-8'
|
|
PIP_DISABLE_PIP_VERSION_CHECK: '1'
|
|
CI: '1'
|
|
CONDARC: ${{ github.workspace }}/.github/.condarc
|
|
|
|
# our stuff
|
|
ATEST_RETRIES: '3'
|
|
CACHE_EPOCH: '1'
|
|
DOIT_N_BUILD: '-n4'
|
|
DOIT_N_TEST: '-n4'
|
|
CONDA_BUILDERER: mambabuild
|
|
|
|
jobs:
|
|
build:
|
|
name: build
|
|
runs-on: ${{ matrix.os }}-latest
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu]
|
|
python-version: ['3.8']
|
|
defaults:
|
|
run:
|
|
shell: bash -l {0}
|
|
env:
|
|
BUILDING_IN_CI: '1'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
# configure builtin providers
|
|
- name: setup (python)
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
architecture: x64
|
|
|
|
- name: setup (node)
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16'
|
|
|
|
# restore caches
|
|
- name: cache (pip)
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-${{ hashFiles('.github/pip-build.txt') }}
|
|
restore-keys: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
|
|
|
|
- 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', '.gitub/pip-build.txt') }}
|
|
|
|
- name: cache (yarn)
|
|
uses: actions/cache@v3
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
id: cache-yarn-packages
|
|
with:
|
|
path: .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/pip-build.txt
|
|
|
|
- name: check (pip)
|
|
run: |
|
|
set -eux
|
|
mkdir -p build/pip
|
|
pip freeze | tee build/pip/dist.pip.freeze
|
|
pip check
|
|
|
|
- name: upload (pip freeze)
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} build pip freeze
|
|
path: ./build/pip/
|
|
|
|
- name: list
|
|
run: doit list --all --status
|
|
|
|
- name: build
|
|
run: doit ${{ matrix.DOIT_N_BUILD }} dist || doit dist
|
|
|
|
- name: status
|
|
run: doit list --all --status | sort
|
|
if: always()
|
|
|
|
- name: upload (dist)
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} dist
|
|
path: ./dist
|
|
|
|
conda-build:
|
|
needs: [build]
|
|
runs-on: ${{ matrix.os }}-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ['ubuntu']
|
|
steps:
|
|
- name: configure line endings
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: cache (conda)
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/conda_pkgs_dir
|
|
key: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-build-${{ hashFiles('.github/environment-conda-build.yml') }}
|
|
restore-keys: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-build-
|
|
|
|
- name: install (conda)
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
environment-file: .github/environment-conda-build.yml
|
|
miniforge-variant: Mambaforge
|
|
use-mamba: true
|
|
|
|
- name: download (dist)
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} dist
|
|
path: ./dist
|
|
|
|
- name: build (conda)
|
|
shell: bash -l {0}
|
|
run: |
|
|
doit -s conda_build
|
|
|
|
- name: upload (conda)
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} conda
|
|
path: ./build/conda-bld
|
|
|
|
conda-test:
|
|
needs: [conda-build]
|
|
runs-on: ${{ matrix.os }}-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ['ubuntu', 'macos', 'windows']
|
|
steps:
|
|
- name: configure line endings
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: cache (conda)
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/conda_pkgs_dir
|
|
key: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-build-${{ hashFiles('.github/environment-*.yml') }}
|
|
restore-keys: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-build-
|
|
|
|
- name: install (conda)
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
if: matrix.os == 'windows'
|
|
with:
|
|
environment-file: .github/environment-conda-build-win.yml
|
|
miniforge-variant: Mambaforge
|
|
use-mamba: true
|
|
|
|
- name: install (conda)
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
if: matrix.os != 'windows'
|
|
with:
|
|
environment-file: .github/environment-conda-build.yml
|
|
miniforge-variant: Mambaforge
|
|
use-mamba: true
|
|
|
|
- name: download (conda)
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} conda
|
|
path: ./build/conda-bld
|
|
|
|
- name: build (conda)
|
|
shell: bash -l {0}
|
|
run: |
|
|
conda index build/conda-bld
|
|
doit -s conda_test || doit -s conda_test
|
|
|
|
test:
|
|
needs: [build]
|
|
name: ${{ matrix.os }} ${{ matrix.python-version }}
|
|
runs-on: ${{ matrix.os }}-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ['ubuntu', 'macos', 'windows']
|
|
python-version: ['3.7', '3.10']
|
|
include:
|
|
- python-version: '3.7'
|
|
CI_ARTIFACT: 'sdist'
|
|
- python-version: '3.10'
|
|
CI_ARTIFACT: 'wheel'
|
|
env:
|
|
TESTING_IN_CI: '1'
|
|
steps:
|
|
- name: configure line endings
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: cache (conda)
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/conda_pkgs_dir
|
|
key: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('.github/environment*.yml') }}
|
|
restore-keys: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-${{ matrix.python-version }}-
|
|
|
|
- name: install (conda)
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
miniforge-variant: Mambaforge
|
|
python-version: ${{ matrix.python-version }}
|
|
environment-file: .github/environment.yml
|
|
use-only-tar-bz2: true
|
|
use-mamba: true
|
|
|
|
- name: tweak install (conda)
|
|
if: matrix.python-version == '3.7'
|
|
shell: bash -l {0}
|
|
run: |
|
|
mamba env update -n test --file .github/environment-py37.yml
|
|
|
|
- name: download (dist)
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} dist
|
|
path: ./dist
|
|
|
|
- name: test (unix)
|
|
if: matrix.os != 'windows'
|
|
shell: bash -l {0}
|
|
run: |
|
|
doit $DOIT_N_TEST test || doit test
|
|
|
|
- name: test (windows)
|
|
if: matrix.os == 'windows'
|
|
shell: cmd /C CALL {0}
|
|
env:
|
|
DOIT_N_TEST: '-n1'
|
|
run: |
|
|
doit %DOIT_N_TEST% test || doit test
|
|
|
|
- name: upload coverage
|
|
shell: bash -l {0}
|
|
run: |
|
|
set -eux
|
|
cd py_packages/ipydrawio
|
|
codecov --root ../..
|
|
cd ../ipydrawio-export
|
|
codecov --root ../..
|
|
|
|
- name: upload (utest)
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name:
|
|
ipydrawio ${{ github.run_number }} utest ${{ matrix.os }}${{
|
|
matrix.python-version }}
|
|
path: ./build/pytest
|
|
|
|
- name: upload (atest)
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name:
|
|
ipydrawio ${{ github.run_number }} atest ${{ matrix.os }}${{
|
|
matrix.python-version }}
|
|
path: ./build/atest
|
|
|
|
docs:
|
|
name: docs
|
|
needs: [build]
|
|
runs-on: ${{ matrix.os }}-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ['ubuntu']
|
|
python-version: ['3.9']
|
|
env:
|
|
ATEST_ARGS: '["--exclude","NOTapp:lite"]'
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: cache (conda)
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/conda_pkgs_dir
|
|
key: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-docs-${{ matrix.python-version }}-${{ hashFiles('./docs/environment.yml') }}
|
|
restore-keys: |
|
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-docs-${{ matrix.python-version }}-
|
|
|
|
- name: cache (yarn)
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .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: install (conda)
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
miniforge-variant: Mambaforge
|
|
python-version: ${{ matrix.python-version }}
|
|
environment-file: docs/environment.yml
|
|
use-only-tar-bz2: true
|
|
use-mamba: true
|
|
|
|
- name: download (dist)
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: ipydrawio ${{ github.run_number }} dist
|
|
path: ./dist
|
|
|
|
- name: build docs
|
|
shell: bash -l {0}
|
|
run: |
|
|
doit $DOIT_N_TEST docs || doit docs || doit docs
|
|
|
|
- name: check docs
|
|
shell: bash -l {0}
|
|
run: |
|
|
doit $DOIT_N_TEST check
|
|
|
|
- name: lite tests
|
|
shell: bash -l {0}
|
|
run: |
|
|
doit $DOIT_N_TEST test:robot
|
|
|
|
- name: upload (atest lite)
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name:
|
|
ipydrawio ${{ github.run_number }} atest ${{ matrix.os }}${{
|
|
matrix.python-version }}
|
|
path: ./build/atest
|
|
|
|
- name: upload (docs)
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name:
|
|
ipydrawio ${{ github.run_number }} docs ${{ matrix.os }}${{
|
|
matrix.python-version }}
|
|
path: ./build/docs
|