Skip to content

build

build #453

Workflow file for this run

name: build
on:
schedule:
- cron: "0 8 * * 2,4,6"
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
build-images:
strategy:
matrix:
version: ['3.8', '3.9', '3.10', '3.11', '3.12']
name: Build Python Docker images
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: build list2term ${{ matrix.version }} image
run:
docker image build --build-arg PYTHON_VERSION=${{ matrix.version }} -t list2term:${{ matrix.version }} .
- name: save list2term ${{ matrix.version }} image
if: ${{ matrix.version == '3.9' }}
run: |
mkdir -p images
docker save --output images/list2term-${{ matrix.version }}.tar list2term:${{ matrix.version }}
- name: upload list2term ${{ matrix.version }} image artifact
if: ${{ matrix.version == '3.9' }}
uses: actions/upload-artifact@v3
with:
name: image
path: images/list2term-${{ 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@v3
with:
name: image
path: images/
- name: load image
run:
docker load --input images/list2term-3.9.tar
- name: prepare report
run: |
ID=$(docker create list2term:3.9)
docker cp $ID:/code/target/reports/list2term_coverage.xml list2term_coverage.xml
sed -i -e 's,filename="list2term/,filename="src/main/python/list2term/,g' list2term_coverage.xml
- name: upload report
uses: codecov/codecov-action@v3
with:
file: list2term_coverage.xml
verbose: true