Skip to content

Updated Chapter 1

Updated Chapter 1 #297

Workflow file for this run

name: CI
on:
push:
branches:
- source
pull_request:
types:
- opened
- synchronize
- reopened
merge_group:
env:
PANDOC_VERSION: "3.0.1"
PYTHON_VERSION: "3.9"
jobs:
check-vehicle:
name: Check Vehicle on ${{ matrix.os.name }}
runs-on: ${{ matrix.os.type }}
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip" # caching pip dependencies
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
shell: sh
- name: Check Vehicle
run: find . -name '*.vcl' -exec vehicle check -s {} \;
shell: sh
strategy:
matrix:
os:
- name: Linux
type: ubuntu-latest
- name: macOS
type: macos-latest
- name: Windows
type: windows-latest
update-readme:
name: Update README.md
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Update README.md
run: make gfm
- name: Commit README.md
if: github.event_name == 'push'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update README.md"
file_pattern: "README.md"
# Compile the tutorial to a PDF
build-pdf:
name: Build PDF
runs-on: ubuntu-latest
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Compile tutorial to LaTeX
run: make latex
- name: Compile tutorial to PDF
uses: xu-cheng/latex-action@v2
with:
latexmk_use_lualatex: true
latexmk_shell_escape: true
extra_system_packages: |
inkscape
python3
pre_compile: |
python -m ensurepip --default-pip
pip install pygments
pip install vehicle_lang
root_file: tutorial.tex
- name: Upload generated PDF as artifact
uses: actions/upload-artifact@v3
with:
name: pdf
path: ./tutorial.pdf
if-no-files-found: error
# Compile the tutorial to an HTML page
build-html:
name: Build HTML
runs-on: ubuntu-latest
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip" # caching pip dependencies
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
shell: sh
- name: Compile tutorial to an HTML page
run: make html
- name: Upload generated HTML page as artifact
uses: actions/upload-artifact@v3
with:
name: html
path: ./_site/
if-no-files-found: error
# Upload the tutorial to pages
update-pages:
name: Update Pages
runs-on: ubuntu-latest
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Get source
uses: actions/checkout@v3
- name: Setup Pandoc
uses: pandoc/actions/[email protected]
with:
version: ${{ env.PANDOC_VERSION }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip" # caching pip dependencies
cache-dependency-path: "requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
shell: sh
- name: Build HTML page
run: make html
- name: Setup Pages
if: github.event_name == 'push'
uses: actions/configure-pages@v3
- name: Upload Pages artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@v1
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
id: deployment
uses: actions/deploy-pages@v2