-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (102 loc) · 3.76 KB
/
build.yaml
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
113
# This is a basic workflow that is manually triggered
name: Build boundary data from source to release
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
collections:
description: 'Boundary collections to process, comma separated, no spaces (default is all collections)'
default: ''
required: false
isos:
description: 'Country ISO3 codes to process, comma separated, no spaces (default is all countries)'
default: ''
required: false
replace:
description: 'Whether to process and replace previously built boundaries (default is True)'
default: 'True'
required: false
write_meta:
description: 'Whether to write the metadata file (default is True)'
default: 'True'
required: false
write_stats:
description: 'Whether to write the stats file (default is True)'
default: 'True'
required: false
write_data:
description: 'Whether to write the boundary data file (default is True)'
default: 'True'
required: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job named "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
# Each step runs a single command using the runners shell
steps:
- name: Inspect initial workspace
run: |
ls
env
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Sparse checkout action, single collection
uses: snow-actions/[email protected]
if: ${{ !contains(github.event.inputs.collections, ',') }}
with:
patterns: |
buildData
sourceData/${{ github.event.inputs.collections }}
releaseData/${{ github.event.inputs.collections }}
topojson_simple
- name: Sparse checkout action, all collections
uses: snow-actions/[email protected]
if: ${{ contains(github.event.inputs.collections, ',') }}
with:
patterns: |
buildData
sourceData
releaseData
topojson_simple
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run build script
run: |
echo "ls root"
ls
echo "ls buildData"
ls buildData
echo "ls sourceData"
ls sourceData
python build.py
env:
INPUT_IS_GITHUB_ACTION: True
INPUT_COLLECTIONS: ${{ github.event.inputs.collections }}
INPUT_ISOS: ${{ github.event.inputs.isos }}
INPUT_REPLACE: ${{ github.event.inputs.replace }}
INPUT_WRITE_META: ${{ github.event.inputs.write_meta }}
INPUT_WRITE_STATS: ${{ github.event.inputs.write_stats }}
INPUT_WRITE_DATA: ${{ github.event.inputs.write_data }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: Build script changes
body: |
This boundary update was run with the following options:
- **COLLECTIONS**: ${{ github.event.inputs.collections }}
- **ISOS**: ${{ github.event.inputs.isos }}
- **REPLACE**: ${{ github.event.inputs.replace }}
- **WRITE_META**: ${{ github.event.inputs.write_meta }}
- **WRITE_STATS**: ${{ github.event.inputs.write_stats }}
- **WRITE_DATA**: ${{ github.event.inputs.write_data }}
delete-branch: true
branch-suffix: short-commit-hash