Skip to content

Commit

Permalink
Update (base update)
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
felix-seifert committed Mar 16, 2024
0 parents commit 279f945
Show file tree
Hide file tree
Showing 136 changed files with 12,028 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI Checks

on:
push:
branches: [ "main" ]
paths-ignore:
- '*.md'
- '*.png'
- '*.svg'
- '*.toml'
- '.gitignore'
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- '*.md'
- '*.png'
- '*.svg'
- '*.toml'
- '.gitignore'

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:

- name: Install required packages (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y locales
sudo locale-gen zh_TW ja_JP ko_KR en_US
sudo update-locale LANG=en_US
echo "LC_ALL=en_US" >> $GITHUB_ENV
echo "LANG=en_US" >> $GITHUB_ENV
echo "LANGUAGE=en_US" >> $GITHUB_ENV
- 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: Unit tests with pytest
run: |
pytest -m 'unit'
- name: Tests with marker 'ubuntu'
if: matrix.os == 'ubuntu-latest'
run: |
pytest -m 'ubuntu'
- name: Tests with marker 'macos'
if: matrix.os == 'macos-latest'
run: |
pytest -m 'macos'
- name: Tests with marker 'windows'
if: matrix.os == 'windows-latest'
run: |
pytest -m 'windows'
- name: Upload image diffs when tests failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: diffs-of-generated-roadmaps-${{ matrix.os }}-${{ matrix.python-version }}
path: |
src/tests/diffs_of_generated_roadmaps/
src/tests/generated_roadmaps/
61 changes: 61 additions & 0 deletions .github/workflows/generate_examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/
37 changes: 37 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint with Ruff

on:
push:
branches: [ "main" ]
paths-ignore:
- '*.md'
- '*.png'
- '*.svg'
- '.gitignore'
- 'images/**'
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- '*.md'
- '*.png'
- '*.svg'
- '.gitignore'
- 'images/**'

jobs:
ruff:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
src
pyproject.toml
requirements.txt
- name: Lint with `ruff check .`
uses: chartboost/ruff-action@v1
Loading

0 comments on commit 279f945

Please sign in to comment.