diff --git a/.ci/build.sh b/.ci/build.sh index 00fbdbc1..e3c4d5e2 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -19,9 +19,9 @@ function setup { function build { setup - make pyinst - make install - make precommit + set -e + make install-devel + make lint make test } @@ -32,7 +32,7 @@ function build_it { docker pull ubuntu/squid:latest - # make it38, it39, etc. + # make it38, it39, etc. so they run as concurrent GHA jobs make "it${1//./}" } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfb0acf8..44393e99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: CI Actions +name: Run Unit Tests on: [workflow_dispatch, pull_request] jobs: Unit-Tests: @@ -8,11 +8,14 @@ jobs: - ubuntu-latest - macos-latest runs-on: ${{ matrix.os }} + steps: - name: Check out repository code uses: actions/checkout@v2 + - name: Clone pyenv run: git clone https://github.com/pyenv/pyenv.git ~/.pyenv + - name: Run the CI build script run: bash .ci/build.sh build env: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d2a80b65..da87a35d 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -31,8 +31,9 @@ jobs: - name: Docker Build ${{ matrix.platform }} run: | - set -x docker buildx version tag=osb/osb-`echo ${{ matrix.platform }} | tr '/' '-'` + set -x docker buildx build --platform ${{ matrix.platform }} --build-arg VERSION=`cat version.txt` --build-arg BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` -f docker/Dockerfile -t "$tag" -o type=docker . + set +x docker images | grep "$tag" diff --git a/Makefile b/Makefile index 24f5ae2a..12888dfe 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ SHELL = /bin/bash PIP = pip3 VERSIONS = $(shell jq -r '.python_versions | .[]' .ci/variables.json | sed '$$d') +VERSION38 = $(shell jq -r '.python_versions | .[]' .ci/variables.json | sed '$$d' | grep 3\.8) PYENV_ERROR = "\033[0;31mIMPORTANT\033[0m: Please install pyenv.\n" pyinst: @@ -25,6 +26,11 @@ pyinst: @for i in $(VERSIONS); do pyenv install --skip-existing $$i; done pyenv local $(VERSIONS) +pyinst38: + @which pyenv > /dev/null || { printf $(PYENV_ERROR); exit 1; } + pyenv install --skip-existing $(VERSION38) + pyenv local $(VERSION38) + check-java: @if ! test "$(JAVA_HOME)" || ! java --version > /dev/null 2>&1 || ! javadoc --help > /dev/null 2>&1; then \ echo "Java installation issues for running integration tests" >&2; \ @@ -40,7 +46,7 @@ install-deps: install-user: install-deps PIP_ONLY_BINARY=h5py $(PIP) install -e . -install-devel: install-deps +install-devel: pyinst38 install-deps PIP_ONLY_BINARY=h5py $(PIP) install -e .[develop] wheel: @@ -71,9 +77,7 @@ lint: test: pytest tests/ -precommit: lint - -it: check-java python-caches-clean tox-env-clean +it: pyinst check-java python-caches-clean tox-env-clean @which tox || $(PIP) install tox tox