-
Notifications
You must be signed in to change notification settings - Fork 96
81 lines (80 loc) · 3.16 KB
/
tests.yaml
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
name: tests
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- _defaults: # see Dockerfile for variable defaults
- TASK_VERSION: v2.4.4
- TASK_VERSION: v2.5.1
- TASK_VERSION: v2.5.3
- TASK_VERSION: v2.6.0
- TASK_VERSION: develop
- VIM_VERSION: v8.0.1850
- VIM_VERSION: v8.1.2424
- VIM_VERSION: v8.2.5172
- VIM_VERSION: v9.0.0000
- VIMWIKI_VERSION: dev
- PYTHON_VERSION: 3.6
- PYTHON_VERSION: 3.7
- PYTHON_VERSION: 3.8
- PYTHON_VERSION: 3.9
- PYTHON_VERSION: "3.10"
continue-on-error: ${{ matrix.continue-on-error == true }}
steps:
- uses: actions/checkout@v2
- name: Prepare docker image
run: |
set -ex -o pipefail
shopt -s lastpipe
git ls-remote https://github.com/GothenburgBitFactory/taskwarrior.git heads/"$TASK_VERSION" | read -r TASK_DEVEL_SHA _ || :
(
echo ALPINE_VERSION="$ALPINE_VERSION"
echo PYTHON_VERSION="$PYTHON_VERSION"
echo TASK_VERSION="$TASK_VERSION" ${TASK_DEVEL_SHA:+TASK_DEVEL_SHA="$TASK_DEVEL_SHA"}
echo VIM_VERSION="$VIM_VERSION"
echo VIMWIKI_VERSION="$VIMWIKI_VERSION"
cat Dockerfile
) | sha256sum | read -r tag _
docker login "$DOCKER_REGISTRY" -u "$GITHUB_USER" -p "$GITHUB_TOKEN" || :
docker pull "$DOCKER_CACHE_IMAGE":"$tag" || :
DOCKER_BUILDKIT=1 docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from "$DOCKER_CACHE_IMAGE":"$tag" \
${ALPINE_VERSION:+--build-arg ALPINE_VERSION="$ALPINE_VERSION"} \
${PYTHON_VERSION:+--build-arg PYTHON_VERSION="$PYTHON_VERSION"} \
${TASK_VERSION:+--build-arg TASK_VERSION="$TASK_VERSION"} \
${VIM_VERSION:+--build-arg VIM_VERSION="$VIM_VERSION"} \
${VIMWIKI_VERSION:+--build-arg VIMWIKI_VERSION="$VIMWIKI_VERSION"} \
-t taskwiki_tests \
.
docker tag taskwiki_tests "$DOCKER_CACHE_IMAGE":"$tag"
docker push "$DOCKER_CACHE_IMAGE":"$tag" || :
env:
ALPINE_VERSION: ${{ matrix.ALPINE_VERSION }}
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
TASK_VERSION: ${{ matrix.TASK_VERSION }}
VIM_VERSION: ${{ matrix.VIM_VERSION }}
VIMWIKI_VERSION: ${{ matrix.VIMWIKI_VERSION }}
DOCKER_REGISTRY: docker.pkg.github.com
DOCKER_CACHE_IMAGE: docker.pkg.github.com/${{ github.repository }}/taskwiki_tests
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: make test PYTEST_FLAGS="-n8"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
coveralls-finished:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Finished
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true