-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1.01 KB
/
Copy pathbuild-pull.yml
File metadata and controls
38 lines (33 loc) · 1.01 KB
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
name: Docker Image CI/CD
on:
pull_request:
branches: [ "*" ]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Prepare repository
run: |
git fetch --unshallow --tags
git tag
- name: Poetry Build
run: |
DOCKER_BUILDKIT=0 docker build -t python-dotjson:build --progress=plain \
--build-arg RUN_TESTS=y .
- name: Extract Code Coverage
run: |
export CONTAINER_ID="$(docker run -dit --entrypoint bash python-dotjson:build)"
echo "CONTAINER_ID: $CONTAINER_ID"
mkdir report
docker cp "${CONTAINER_ID}:/project/pytest-coverage.txt" ./
docker stop $CONTAINER_ID
docker container rm $CONTAINER_ID
echo "Test coverage file extracted"
cat pytest-coverage.txt
- name: Comment unit tests and coverage
uses: machine-learning-apps/pr-comment@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: pytest-coverage.txt