mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-18 21:33:07 +02:00
76 lines
3 KiB
YAML
76 lines
3 KiB
YAML
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: 2.5.2
|
|
continue-on-error: true
|
|
- TASK_VERSION: 2.6.0
|
|
- VIM_VERSION: v7.4.1546
|
|
- VIM_VERSION: v8.0.0027
|
|
- VIM_VERSION: v8.1.0519
|
|
- VIMWIKI_VERSION: dev
|
|
- PYTHON_VERSION: 3.5
|
|
- PYTHON_VERSION: 3.6
|
|
- PYTHON_VERSION: 3.7
|
|
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-finished:
|
|
needs: tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Finished
|
|
uses: coverallsapp/github-action@v1.1.1
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
parallel-finished: true
|