-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (106 loc) · 3.17 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI/CD Pipeline for IQM Benchmarks
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
run_tests:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.3
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install tox==4.16.0
- name: Check Python packages
run: python -m pip check
- name: Run tests
run: tox -e test
run_benchmark:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.3
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install tox==4.16.0
- name: Run benchmark
run: tox -e benchmark -- --backend=${{ github.event.inputs.backend || 'iqmfakeadonis' }}
- name: Upload benchmark results
uses: actions/upload-artifact@v2
with:
name: benchmark-results
path: Outputs
test_version_tag:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: Verify changelog version
run: bash ./tag-from-pipeline.sh verify_changelog_version
automatic_tag:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Create new tag
run: bash ./tag-from-pipeline.sh create_new_tag
if: |
github.event_name == 'push' &&
github.event.head_commit.message != 'skip ci' &&
contains(github.event.head_commit.message, 'CHANGELOG.rst')
publish_dist:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11.3
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install tox==4.16.0
- name: Build distribution
run: tox -e build
- name: Publish distribution
run: tox -e publish
- name: Upload version file
uses: actions/upload-artifact@v2
with:
name: version.txt
path: version.txt