-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,37 +2,48 @@ | |
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- name: Install prerequisites | ||
- name: Install ubuntu prerequisites | ||
run: | | ||
sudo apt-get update -qq | ||
xargs -a ubuntu-packages.txt sudo apt install -qq | ||
python -m pip install --quiet --upgrade pip | ||
pip install --quiet -r requirements.txt | ||
sudo apt update -qq | ||
xargs -a ubuntu-packages.txt sudo apt install -qq | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- name: Install python prerequisites | ||
run: pip install --quiet -r requirements.txt | ||
- name: Checks | ||
run: | | ||
pre-commit run --all | ||
mkdir -p build/reuse | ||
# ignore fail for reuse | ||
reuse lint > build/reuse/lint.txt || true | ||
- name: Build | ||
pre-commit run --all | ||
mkdir -p build/reuse | ||
# ignore fail for reuse | ||
reuse lint > build/reuse/lint.txt || true | ||
- name: Build html | ||
env: | ||
ONEAPI_DRAFT: true | ||
run: | | ||
python scripts/oneapi.py -W html | ||
- name: Build pdf | ||
env: | ||
ONEAPI_DRAFT: true | ||
run: | | ||
python scripts/oneapi.py -W latexpdf | ||
- name: Archive build directory | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build | ||
path: build | ||
#- name: Archive build directory | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: build | ||
# path: build | ||
- name: Checkout gh-pages | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: actions/checkout@v3 | ||
|
@@ -42,15 +53,15 @@ jobs: | |
- name: Publish to github pages | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
cd gh-pages | ||
touch .nojekyll | ||
rm -rf spec | ||
mkdir spec | ||
cd spec | ||
cp -r ../../build/html/* . | ||
cp ../../build/latex/*.pdf . | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add . | ||
git commit --reset-author --amend -m "Update from github actions" | ||
git push --force origin gh-pages | ||
cd gh-pages | ||
touch .nojekyll | ||
rm -rf spec | ||
mkdir spec | ||
cd spec | ||
cp -r ../../build/html/* . | ||
cp ../../build/latex/*.pdf . | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add . | ||
git commit --reset-author --amend -m "Update from github actions" | ||
git push --force origin gh-pages |
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