This repository has been archived by the owner on May 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (69 loc) · 2.47 KB
/
install-test.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
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
82
83
84
85
name: Python install
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Cache virtual environment
uses: actions/cache@v3
with:
path: .venv
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock')}}
restore-keys: ${{ runner.os }}-venv-${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Make
run: make
- name: Replace local coverage.xml path by docker path for Sonar
run: sed -i 's/\/home\/runner\/work\/giskard-client\/giskard-client\//\/github\/workspace\//g' coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Extract current package version
if: ${{ steps.extract_branch.outputs.branch == 'main' }}
uses: SebRollen/[email protected]
id: read_toml
with:
file: 'pyproject.toml'
field: 'tool.poetry.version'
- name: Get current date
if: ${{ steps.extract_branch.outputs.branch == 'main' }}
id: current_date
env:
TZ: Europe/Paris
run: echo "CURRENT_DATE=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: Set dev version
if: ${{ steps.extract_branch.outputs.branch == 'main' }}
uses: ciiiii/[email protected]
with:
file: "pyproject.toml"
key: "tool.poetry.version"
value: '${{ steps.read_toml.outputs.value }}.dev${{ steps.current_date.outputs.CURRENT_DATE }}'
- name: Build dev version
run: |
make build
- name: Archive built artifacts
if: ${{ steps.extract_branch.outputs.branch == 'main' }}
uses: actions/upload-artifact@v3
with:
name: giskard-dev-${{ matrix.python-version }}.whl
path: dist/*whl