-
Notifications
You must be signed in to change notification settings - Fork 20
61 lines (51 loc) · 1.74 KB
/
generate_examples.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
name: Generate example roadmaps
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
src
pyproject.toml
requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate roadmaps (non-Windows)
if: matrix.os != 'windows-latest'
run: |
# Get only part before `-` of matrix.os
os=$(echo "${{ matrix.os }}" | cut -d- -f1)
# Capitalise first letter of os
os="$(tr '[:lower:]' '[:upper:]' <<< ${os:0:1})${os:1}"
mkdir "examples"
python -m src.tests.roadmap_generators.roadmap_generator --operating-system $os --target-directory examples
- name: Generate roadmaps (Windows)
if: matrix.os == 'windows-latest'
run: |
# Get only part before `-` of matrix.os
$os = "${{ matrix.os }}" -split "-" | Select-Object -First 1
# Capitalise first letter of os
$os = $os.Substring(0, 1).ToUpper() + $os.Substring(1)
mkdir examples
python -m src.tests.roadmap_generators.roadmap_generator --operating-system $os --target-directory examples
- name: Upload generated roadmaps
uses: actions/upload-artifact@v4
with:
name: example-roadmaps-${{ matrix.os }}
path: examples/