Skip to content
This repository was archived by the owner on Feb 11, 2023. It is now read-only.

Commit f1648b2

Browse files
committed
CI: dockers & triggers
1 parent a930cc9 commit f1648b2

File tree

6 files changed

+45
-53
lines changed

6 files changed

+45
-53
lines changed

.github/workflows/ci_pkg-install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Install package
22

33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the master branch
5-
push:
5+
push: {}
6+
pull_request:
67
branches: [master]
7-
pull_request: {}
88

99
jobs:
1010
pkg-check:

.github/workflows/ci_testing.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: CI testing
22

33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the master branch
5-
push:
5+
push: {}
6+
pull_request:
67
branches: [master]
7-
pull_request: {}
88

99
jobs:
10-
pytest:
1110

11+
pytest:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false
@@ -17,12 +17,8 @@ jobs:
1717
python-version: [3.6, 3.9]
1818
requires: ['latest']
1919
include:
20-
- os: "ubuntu-18.04"
21-
python-version: 2.7
22-
requires: 'latest'
23-
- os: "ubuntu-18.04"
24-
python-version: 3.6
25-
requires: 'minimal'
20+
- {os: "ubuntu-18.04", python-version: 2.7, requires: 'latest'}
21+
- {os: "ubuntu-18.04", python-version: 3.6, requires: 'oldest'}
2622

2723
# Timeout: https://stackoverflow.com/a/59076067/4521646
2824
timeout-minutes: 35
@@ -51,7 +47,7 @@ jobs:
5147
pip install -U backports.functools_lru_cache
5248
5349
- name: Set min. dependencies
54-
if: matrix.requires == 'minimal'
50+
if: matrix.requires == 'oldest'
5551
run: |
5652
for fpath in ('requirements.txt', 'tests/requirements.txt'):
5753
req = open(fpath).read().replace('>=', '==')

.github/workflows/docker-builds.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Publish Docker Image
22
# https://www.docker.com/blog/first-docker-github-action-is-here
33
# https://github.com/docker/build-push-action
44
on: # Trigger the workflow on push or pull request, but only for the master branch
5-
push:
6-
branches: [master]
5+
push: {}
76
pull_request:
87
branches: [master]
98
types: [opened, reopened, ready_for_review, synchronize]
@@ -14,22 +13,23 @@ jobs:
1413
if: github.event.pull_request.draft == false
1514
runs-on: ubuntu-20.04
1615
strategy:
16+
fail-fast: false
1717
matrix:
18-
python_version: [3.7, 3.8, 3.9]
18+
python_version: ["3.7", "3.8", "3.9"]
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v2
2222
# https://github.com/docker/setup-buildx-action
2323
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
2424
- uses: docker/setup-buildx-action@v1
2525
- name: Login to DockerHub
26+
if: ${{ github.repository_owner == 'Borda' }}
2627
uses: docker/login-action@v1
2728
with:
2829
username: ${{ secrets.DOCKER_USERNAME }}
2930
password: ${{ secrets.DOCKER_PASSWORD }}
3031

3132
- name: Build and Publish to Docker Hub
32-
# publish master
3333
uses: docker/build-push-action@v2
3434
# https://github.com/docker/build-push-action#cache-to-registry
3535
with:
@@ -38,6 +38,6 @@ jobs:
3838
cache-from: type=registry,ref=borda/birl:SOTA-py${{ matrix.python_version }}
3939
cache-to: type=inline
4040
file: bm_experiments/Dockerfile
41-
push: ${{ github.ref == 'refs/heads/master' }}
41+
push: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
4242
tags: borda/birl:SOTA-py${{ matrix.python_version }}
4343
timeout-minutes: 240

.github/workflows/docs-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: "Docs check"
33

44
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
55
on: # Trigger the workflow on push or pull request, but only for the master branch
6-
push:
6+
push: {}
7+
pull_request:
78
branches: [master]
8-
pull_request: {}
99

1010
jobs:
1111

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ repos:
1313
hooks:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
16+
- id: check-case-conflict
1617
- id: check-yaml
17-
- id: pretty-format-json
18+
- id: check-toml
19+
- id: check-json
20+
- id: check-added-large-files
21+
- id: check-docstring-first
22+
- id: detect-private-key
1823

1924
#- repo: https://github.com/pre-commit/mirrors-autopep8
2025
# rev: v1.5.7

bm_experiments/Dockerfile

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ SHELL ["/bin/bash", "-c"]
1010
# for installing tzdata see: https://stackoverflow.com/a/58264927/4521646
1111
ENV DEBIAN_FRONTEND=noninteractive
1212

13-
RUN apt-get update && \
13+
RUN apt-get update -qq --fix-missing && \
1414
apt-get install -y --no-install-recommends software-properties-common && \
1515
add-apt-repository ppa:deadsnakes/ppa && \
16-
apt-get update && \
16+
apt-get update -qq --fix-missing && \
1717
apt-get install -y --no-install-recommends \
1818
python${PYTHON_VERSION} \
1919
python${PYTHON_VERSION}-dev \
@@ -45,31 +45,9 @@ RUN apt-get update && \
4545
apt-get clean && \
4646
rm -rf /var/lib/apt/lists/*
4747

48-
RUN \
49-
# BIRL requirement
50-
apt-get update && \
51-
apt-get install -y --no-install-recommends \
52-
openslide-tools \
53-
&& \
54-
55-
# Download BIRL from master
56-
wget https://github.com/Borda/BIRL/archive/master.zip --progress=bar:force:noscroll && \
57-
unzip -q master.zip && \
58-
rm master.zip && \
59-
mv BIRL-master BIRL && \
60-
61-
# Install BIRL
62-
# v46 crashes openslide-python install
63-
pip install "setuptools<46" -U && \
64-
pip install ./BIRL --no-cache-dir && \
65-
python -c "import birl ; print(birl.__version__)" && \
66-
mkdir BIRL/Applications && \
67-
# Cleaning
68-
apt-get clean && \
69-
rm -rf /var/lib/apt/lists/*
70-
7148
ENV BIRL_APPs_PATH="/BIRL/Applications"
7249

50+
RUN mkdir -p $BIRL_APPs_PATH
7351

7452
RUN \
7553
cd $BIRL_APPs_PATH && \
@@ -84,7 +62,7 @@ RUN \
8462
ENV ANTs_VERSION="2.3.4"
8563

8664
RUN \
87-
apt-get update && \
65+
apt-get update -qq && \
8866
apt-get install -y --no-install-recommends \
8967
zlib1g-dev \
9068
&& \
@@ -127,7 +105,7 @@ RUN \
127105
ENV ANTSPY_VERSION="0.2.5"
128106

129107
RUN \
130-
apt-get update && \
108+
apt-get update -qq && \
131109
apt-get install -y --no-install-recommends \
132110
libopenblas-dev \
133111
liblapack-dev \
@@ -163,8 +141,7 @@ RUN \
163141
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BIRL_APPs_PATH/elastix/lib/"
164142

165143
RUN \
166-
# add required libs
167-
apt-get update && \
144+
apt-get update -qq && \
168145
apt-get install -y --no-install-recommends \
169146
libtbb-dev \
170147
libboost-all-dev \
@@ -228,8 +205,7 @@ RUN \
228205
$BIRL_APPs_PATH/DROP2/dropreg --help
229206

230207
RUN \
231-
# add required libs
232-
apt-get update && \
208+
apt-get update -qq && \
233209
apt-get install -y --no-install-recommends \
234210
r-base-core \
235211
r-base-dev \
@@ -258,10 +234,25 @@ RUN \
258234
# try to run RNiftyReg
259235
R -e 'library(RNiftyReg)'
260236

237+
COPY ./ /BIRL/
238+
239+
RUN \
240+
apt-get update -qq && \
241+
apt-get install -y --no-install-recommends \
242+
openslide-tools \
243+
&& \
244+
# Install BIRL
245+
# v46 crashes openslide-python install
246+
pip install "setuptools<46" -U && \
247+
pip install ./BIRL --no-cache-dir && \
248+
python -c "import birl ; print(birl.__version__)" && \
249+
# Cleaning
250+
apt-get clean && \
251+
rm -rf /var/lib/apt/lists/*
252+
261253

262254
RUN \
263-
# show installed applications
264-
apt-get update && \
255+
apt-get update -qq && \
265256
apt-get install -y --no-install-recommends \
266257
tree \
267258
&& \

0 commit comments

Comments
 (0)