forked from elastic/rally-tracks
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (94 loc) · 3.31 KB
/
ci.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
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 14 * * *'
# Allows triggering the job manually
workflow_dispatch:
env:
DEFAULT_BRANCH: master
permissions: "read-all"
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml
- name: "Install dependencies"
run: python -m pip install .[develop]
- uses: pre-commit/[email protected]
- uses: elastic/es-perf-github-status@v2
if: ${{ failure() && ( github.event_name == 'schedule' || ( github.event_name == 'push' && github.ref_name == env.DEFAULT_BRANCH ) ) }}
with:
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: ${{ secrets.SLACK_CHANNEL }}
status: FAILED
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
name: ${{ fromJson('{"macos-latest":"macOS","ubuntu-latest":"Ubuntu"}')[matrix.os] }} ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "Install dependencies"
run: python -m pip install .[develop]
- name: "Run tests"
run: hatch -v -e unit run test
- uses: elastic/es-perf-github-status@v2
if: ${{ failure() && ( github.event_name == 'schedule' || ( github.event_name == 'push' && github.ref_name == env.DEFAULT_BRANCH ) ) }}
with:
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: ${{ secrets.SLACK_CHANNEL }}
status: FAILED
rally-tracks-compat:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- run: echo "JAVA17_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- run: echo "JAVA11_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
- name: "Install dependencies"
run: python -m pip install .[develop]
- name: "Run tests"
run: hatch -v -e it run test
timeout-minutes: 120
env:
# elastic/endpoint fetches assets from GitHub, authenticate to avoid
# being rate limited
ASSETS_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: elastic/es-perf-github-status@v2
if: ${{ failure() && ( github.event_name == 'schedule' || ( github.event_name == 'push' && github.ref_name == env.DEFAULT_BRANCH ) ) }}
with:
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: ${{ secrets.SLACK_CHANNEL }}
status: FAILED
# Artifact will show up under "Artifacts" in the "Summary" page of runs
- uses: actions/upload-artifact@v3
if: always()
with:
name: rally-tracks-compat-logs
path: /home/runner/.rally/logs/
if-no-files-found: error