Skip to content

* biblio.bib: Use dagstuhl-lzi. #517

* biblio.bib: Use dagstuhl-lzi.

* biblio.bib: Use dagstuhl-lzi. #517

name: CI
on:
push:
branches:
- master
- main
paths-ignore: ['README.md','bibpool/**','**precommit*','setup_worktree.sh','mklog','**.latexmkrc','.gitignore']
pull_request:
paths-ignore: ['README.md','bibpool/**','**precommit*','setup_worktree.sh','mklog','**.latexmkrc','.gitignore']
env:
cache-version: v2
jobs:
ci:
if: "! contains(github.event.head_commit.message, '[skip ci]')"
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
dotest: ${{ steps.filter.outputs.dotest }}
steps:
- run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: πŸ“₯ Check out repository
uses: actions/checkout@v5
with:
fetch-depth: 50
- name: πŸ’‘ List files in the repository
run: |
ls -R ${{ github.workspace }}
- name: πŸ” Analyse changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
bibcheck: [ 'crossref.bib', 'biblio.bib', './scripts/bibcheck.R', './github/**.yml' ]
doicheck: [ 'articles.bib', 'biblio.bib', 'crossref.bib', './scripts/doi_check.R', './github/**.yml' ]
linter: [ './*.bib', './scripts/linter', './github/**.yml' ]
fastcheck: [ './*.bib', './scripts/fast_check.sh', './github/**.yml' ]
dotest: [ './*.bib', './test/test.sh', './test/*.bst', './test/*.tex', './github/**.yml']
- name: 🧹 Fast check
if: ${{ steps.filter.outputs.fastcheck == 'true' }}
run: ./scripts/fast_check.sh *.bib
- name: 🧹 Linter
if: ${{ steps.filter.outputs.linter == 'true' && github.event_name == 'push' }}
run: |
./scripts/linter *.bib && exit 0
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add *.bib
(git commit -m "Linter '.bib' files [skip ci]" && git pull --rebase && git push origin) || echo "No changes to commit"
- name: πŸ” Extract changed DOI entries
id: extract-dois
run: |
# Check for pull request vs push
if [ "${{ github.event_name }}" = "pull_request" ]; then
base_ref="${{ github.event.pull_request.base.sha }}"
else
# Use GitHub `before` ref for push events, fallback to `git rev-list` if necessary
if [ -n "${{ github.event.before }}" ]; then
base_ref="${{ github.event.before }}"
else
first_commit_in_push=$(git rev-list --boundary $(git rev-parse HEAD) --not $(git rev-parse HEAD^) | grep -e "^-" | sed 's/^-//')
base_ref="$first_commit_in_push"
fi
# Ensure base_ref exists locally, try to unshallow fetch if it doesn't
if ! git cat-file -e "${base_ref}^{commit}" 2>/dev/null; then
echo "⚠️ Base ref $base_ref not found locally. Attempting unshallow fetch."
git fetch --unshallow
if ! git cat-file -e "${base_ref}^{commit}" 2>/dev/null; then
echo "⚠️ Base ref $base_ref still not found. Using HEAD^ as fallback."
base_ref=$(git rev-parse HEAD^)
fi
fi
fi
changed_entries=$(./scripts/extract_changed_dois.sh "$base_ref")
echo "changed_entries=$changed_entries" >> $GITHUB_OUTPUT
echo "Final changed DOI entries: $changed_entries"
# Set doicheck to false if no changed entries found
if [ -z "$changed_entries" ]; then
echo "No changed DOI entries found, skipping DOI validation"
echo "doicheck_needed=false" >> $GITHUB_OUTPUT
else
echo "doicheck_needed=true" >> $GITHUB_OUTPUT
fi
- uses: r-lib/actions/setup-r@v2
if: (steps.filter.outputs.bibcheck == 'true' || steps.extract-dois.outputs.doicheck_needed == 'true')
- uses: r-lib/actions/setup-r-dependencies@v2
if: steps.filter.outputs.bibcheck == 'true'
with:
packages: cran::rbibutils
dependencies: '"hard"'
- uses: r-lib/actions/setup-r-dependencies@v2
if: steps.extract-dois.outputs.doicheck_needed == 'true'
with:
packages: |
cran::rbibutils
cran::jsonlite
cran::httr2
dependencies: '"hard"'
- run: Rscript ./scripts/bibcheck.R
if: steps.filter.outputs.bibcheck == 'true'
- name: "Running DOI check for changed entries: ${{ steps.extract-dois.outputs.changed_entries }}"
if: steps.extract-dois.outputs.doicheck_needed == 'true'
run: |
Rscript ./scripts/doi_check.R --changed-entries "${{ steps.extract-dois.outputs.changed_entries }}"
- name: πŸ“Š Report results
if: failure() && (steps.filter.outputs.bibcheck == 'true' || steps.extract-dois.outputs.doicheck_needed == 'true')
run: |
echo "❌ Bibliography or DOI validation failed - see above for details"
exit 1
- name: πŸ“Š Report results
if: success() && (steps.filter.outputs.bibcheck == 'true' || steps.extract-dois.outputs.doicheck_needed == 'true')
run: |
echo "βœ… All bibliography and DOI checks passed!"
test:
name: BibTeX Testing ${{ matrix.main }}.tex ${{ matrix.style }}.bst
needs: ci
if: ${{ needs.ci.outputs.dotest == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
main: ["testbib", "testshortbib"]
style: ["../bibstyles/splncs04abbrev", "../bibstyles/abbrvnatamp", "../bibstyles/ACM-Reference-Format"]
include:
- main: "testbiblatex"
style: ""
- main: "testbib"
style: "testbib"
- main: "testshortbib"
style: "testshortbib"
steps:
- name: πŸ“₯ Check out repository
uses: actions/checkout@v5
# - name: πŸ“‹ Cache TinyTeX
# id: cache-tinytex
# uses: actions/cache@v4
# with:
# path: ~/.TinyTeX
# key: ${{ env.cache-version }}-${{ runner.os }}-tinytex-${{ hashFiles('.github/texlive_packages') }}
# restore-keys: |
# ${{ env.cache-version }}-${{ runner.os }}-tinytex-
- name: πŸ”§ Setup TinyTeX
uses: r-lib/actions/setup-tinytex@v2-branch
#if: ${{ env.FILES_CHANGED != 0 }} #&& steps.cache-tinytex.outputs.cache-hit != 'true'}}
env:
TINYTEX_INSTALLER: TinyTeX-1
TINYTEX_VERSION: 2023.12
- name: πŸ“¦ Install LaTeX packages
#if: ${{ env.FILES_CHANGED != 0 }} #&& steps.cache-tinytex.outputs.cache-hit != 'true'}}
run: |
texlive_packages=./.github/texlive_packages
which tlmgr
tlmgr --version
echo "Updating TexLive"
# Keep no backups (not required, simply makes cache bigger)
tlmgr option repository https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2023/tlnet-final
tlmgr option -- autobackup 0
echo "Updating tlmgr itself"
tlmgr update --self
echo "Install ${texlive_packages}"
tlmgr install $(sed 's/\s*#.*//;/^\s*$/d' "${texlive_packages}")
tlmgr path add
- name: πŸ§ͺ Run LaTeX tests
run: |
cd test && ./test.sh -single ${{ matrix.main }} ${{ matrix.style }}
- name: πŸ“¦ Install system packages
if: ${{ success() && (matrix.main == matrix.style) }}
run: |
sudo apt -y install ghostscript qpdf
- name: πŸ—œοΈ Compress PDFs
if: ${{ success() && (matrix.main == matrix.style) }}
run: cd test && ./compress.sh ${{ matrix.main }}.pdf && mv --force -t ../web/ ${{ matrix.main }}.pdf
- name: πŸ“€ Upload build artifacts
if: ${{ success() && (matrix.main == matrix.style) }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.main }}
path: ./web/${{ matrix.main }}.pdf
retention-days: 30
deploy:
name: Deploy to github pages
needs: test
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Check out repository
uses: actions/checkout@v4
- name: πŸ“₯ Download build artifacts
uses: actions/download-artifact@v5
with:
pattern: test*bib*
path: web
merge-multiple: true
- name: πŸ“¦ Install system packages
run: |
sudo apt -y install bibtex2html tidy
- name: optbib2html
run: ./scripts/optbib2html.sh
- name: πŸš€ Deploy
if: ${{ success() && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web # The folder the action should deploy.
clean: true
single-commit: true
- run: echo "🍏 This job's status is ${{ job.status }}."