-
Notifications
You must be signed in to change notification settings - Fork 54
95 lines (87 loc) · 3.44 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CI
on: [push, pull_request]
jobs:
target:
strategy:
matrix:
ci_target:
- ci_housekeeping
- ci_unit_tests
- integration_tests
- viral_refbased
- viral_assemble
# disabled due to test data bitrot (Apr 2023)
# - skylab_bulk_rna
runs-on: ubuntu-20.04
steps:
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: docker build
run: |
# Cache the dependency-installation image layer on GitHub Packages to speed up CI. Use a
# year/month tag to ensure we do refresh them occasionally.
DOCKER_TAG="docker.pkg.github.com/${GITHUB_REPOSITORY}/miniwdl_ci:$(date +%Y%m)"
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
if docker pull "$DOCKER_TAG"; then
docker build -t "$DOCKER_TAG" --cache-from "$DOCKER_TAG" .
else
docker build -t "$DOCKER_TAG" .
fi
if [ "${{ matrix.ci_target }}" == "ci_housekeeping" ]; then
docker push "$DOCKER_TAG" || true # allow failure for third-party PRs
fi
- name: make ${{ matrix.ci_target }}
run: |
chmod -R ugo+rw .
# AWS_EC2_METADATA_DISABLED needed on Azure: https://github.com/aws/aws-cli/issues/5623
docker run \
--group-add $(stat -c %g /var/run/docker.sock) -v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd):/home/wdler/miniwdl -v /tmp:/tmp \
-e AWS_EC2_METADATA_DISABLED=true -e CI=true \
"$DOCKER_TAG" make -C miniwdl ${{ matrix.ci_target }}
- name: Coveralls
if: ${{ matrix.ci_target == 'ci_unit_tests' }}
# https://github.com/coverallsapp/github-action/issues/30
# https://github.com/marketplace/actions/coveralls-python
uses: AndreMiras/coveralls-python-action@develop
bionic_self_test:
# run_self_test in a ubuntu:18.04 image with only the minimal runtime dependencies installed
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: docker build
run: |
mkdir bionic_self_test
cp requirements.txt bionic_self_test
cat << 'EOF' > bionic_self_test/Dockerfile
FROM ubuntu:18.04
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y python3-pip
RUN useradd -ms /bin/bash -u 1337 wdler
USER wdler
WORKDIR /home/wdler
RUN mkdir miniwdl
COPY requirements.txt /home/wdler/
RUN pip3 install --user -r requirements.txt
ENV PYTHONPATH $PYTHONPATH:/home/wdler/.local/lib/python3.6
ENV PATH $PATH:/home/wdler/.local/bin
# expectation -- mount miniwdl source tree at /home/wdler/miniwdl
CMD env -C miniwdl python3 -m WDL run_self_test
EOF
docker build -t miniwdl_bionic_self_test bionic_self_test
- name: miniwdl run_self_test
run: |
docker run \
--group-add $(stat -c %g /var/run/docker.sock) -v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd):/home/wdler/miniwdl -v /tmp:/tmp \
-e AWS_EC2_METADATA_DISABLED=true \
miniwdl_bionic_self_test