WIP: feature: begin to add parity block chapter #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master, main ] | |
pull_request: | |
branches: [ master, main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12.2' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r scripts/requirements.txt | |
- name: Run pytest | |
run: pytest | |
build: | |
runs-on: ubuntu-latest | |
container: makeappdev/uselatex:latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git safe directory with GITHUB_WORKSPACE | |
run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
- name: Build | |
run: | | |
cmake --version; pdflatex --version | |
mkdir -p build && cd build | |
cmake .. | |
make | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifact | |
path: ./build/*.pdf | |
- name: Comment on PR with artifact link | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const pr_number = context.payload.pull_request.number | |
const run_id = process.env.GITHUB_RUN_ID | |
const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}` | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: pr_number, | |
body: `:robot: The artifacts from this build are available [here](${run_url}).` | |
}) | |
- name: Prepare Deployment | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
run: | | |
mkdir -p export | |
echo "# This branch is for deployment only" >> export/README.md | |
cp build/*.pdf export | |
cp build/git.id export | |
- name: Deploy | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: export | |
single-commit: true | |
silent: true |