Skip to content

Generate example roadmaps #4

Generate example roadmaps

Generate example roadmaps #4

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@v4
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@v3
with:
name: example-roadmaps-${{ matrix.os }}
path: examples/