-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (56 loc) · 1.8 KB
/
main.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
name: build
on:
schedule:
- cron: "0 8 * * *"
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
build-images:
strategy:
matrix:
version: ['3.7', '3.8', '3.9', '3.10']
name: Build Python Docker images
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: build github3api ${{ matrix.version }} image
run:
docker image build --target build-image --build-arg PYTHON_VERSION=${{ matrix.version }} -t github3api:${{ matrix.version }} .
- name: save github3api ${{ matrix.version }} image
if: ${{ matrix.version == '3.9' }}
run: |
mkdir -p images
docker save --output images/github3api-${{ matrix.version }}.tar github3api:${{ matrix.version }}
- name: upload github3api ${{ matrix.version }} image artifact
if: ${{ matrix.version == '3.9' }}
uses: actions/upload-artifact@v2
with:
name: image
path: images/github3api-${{ matrix.version }}.tar
coverage:
name: Publish Code Coverage Report
needs: build-images
runs-on: ubuntu-20.04
steps:
- name: download image artifact
uses: actions/download-artifact@v2
with:
name: image
path: images/
- name: load image
run:
docker load --input images/github3api-3.9.tar
- name: prepare report
run: |
ID=$(docker create github3api:3.9)
docker cp $ID:/code/target/reports/github3api_coverage.xml github3api_coverage.xml
sed -i -e 's,filename="github3api/,filename="src/main/python/github3api/,g' github3api_coverage.xml
- name: upload report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: github3api_coverage.xml