-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 2.25 KB
/
fly-helicopter.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
name: Scrape Test cricket matches hosted data into JSON file
on:
workflow_call:
jobs:
fly-helicopter:
name: Scrape and clean data
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: python/helicopter
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
repository: dragondive/masadora
- name: Setup python
id: setup-python
uses: actions/[email protected]
with:
python-version: '>=3.12'
- name: Load cached poetry
id: cached-poetry
uses: actions/[email protected]
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-0
- name: Install poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/[email protected]
with:
virtualenvs-path: ${{ runner.temp }}/venv/helicopter-${{ hashFiles('python/helicopter/poetry.lock') }}
- name: Configure poetry
if: steps.cached-poetry.outputs.cache-hit == 'true'
run: |
poetry config \
virtualenvs.path ${{ runner.temp }}/venv/helicopter-${{ hashFiles('python/helicopter/poetry.lock') }}
- name: Load cached dependencies
id: cached-dependencies
uses: actions/[email protected]
with:
path: ${{ runner.temp }}/venv/helicopter-${{ hashFiles('python/helicopter/poetry.lock') }}
key: helicopter-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('python/helicopter/poetry.lock') }}
- name: Install dependencies
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction
- name: Fly helicopter
run: |
poetry run helicopter-cli \
--output-file-path cricket_grounds_test_matches_hosted.json \
--save-grounds-data-file-path cricket_grounds_data.csv
- name: Upload artifacts
uses: actions/[email protected]
with:
name: fly-helicopter-artifacts
path: |
python/helicopter/cricket_grounds_data.csv
python/helicopter/cricket_grounds_test_matches_hosted.json