Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ci #45

Merged
merged 6 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
name: CI build of the standard
# This file generated from a template file maintained in the ivoatex repository.
# To create and install it into a project repository, do:
# make github-preview
# git commit
# git push
#
name: Check the IVOA document

on:
env:
doc_name: DALI

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Setup dependencies
run: |
sudo apt update
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc ghostscript cm-super librsvg2-bin inkscape

sudo apt install texlive-latex-base texlive-latex-recommended \
texlive-latex-extra texlive-fonts-recommended \
pdftk xsltproc latexmk cm-super

- name: Build the document
run: make role_diagram.pdf biblio forcetex
run: make

- name: Check the output
run: |
test -f DALI.pdf
test -f DALI.bbl

- uses: actions/upload-artifact@v1
test -f ${{ env.doc_name }}.pdf
test -f ${{ env.doc_name }}.bbl

- name: Keep the PDF artefact
uses: actions/upload-artifact@v4
with:
name: DALI.pdf Preview
path: DALI.pdf
name: PDF Preview
path: ${{ env.doc_name }}.pdf
76 changes: 41 additions & 35 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# This file generated from a template file maintained in the ivoatex repository.
# To create and install it into a project repository, do:
# make github-preview
# git commit
# git push
#
name: Update PDF Preview

env:
doc_name: DALI
doc_name :

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc_name isn't set here, so later in L38 the ${{ env.doc_name }}-draft.pdf substitution becomes -draft.pdf. It "passed" (i.e. didn't run) in the PR because this workflow will only run on pushes to the main branch.

Is doc_name supposed to be set dynamically somewhere?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. The update-ci target does not set this field in the CI configuration file. It was already done like that before. But sure, maybe we can do better by doing that automatically with this Makefile target.

Sorry again for this issue.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking now at the Makefile code, we are already doing this automatically when DOCNAME is set in the Makefile. But the problem is due to the spaces I have added between doc_name and the :. What a stupid mistake...sorry, I push a new PullRequest to fix this. I hope this time it will be OK.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See PullRequest ivoa-std/ivoatex#143 for a fix

branch_name: ${{ github.head_ref || github.ref_name }}
tag_preview: auto-pdf-preview

on:
push:
Expand All @@ -10,51 +18,49 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:

- name: Checkout the repository
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
submodules: true

- name: Setup dependencies
run: |
sudo apt update
sudo apt install texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended xsltproc latexmk cm-super
sudo snap install pdftk
sudo apt install texlive-latex-base texlive-latex-recommended \
texlive-latex-extra texlive-fonts-recommended \
pdftk xsltproc latexmk cm-super

- name: Build the document
run: make ${{ env.doc_name }}-draft.pdf
run: make biblio ${{ env.doc_name }}-draft.pdf

- name: Check the output
run: |
test -f ${{ env.doc_name }}-draft.pdf
test -f ${{ env.doc_name }}.bbl

- name: Move the auto-pdf-preview tag
uses: weareyipyip/walking-tag-action@v2
with:
tag-name: auto-pdf-preview
tag-message: |
Last commit taken into account for the automatically updated PDF preview of this IVOA document.

- name: Remove the former PDF preview
run: |
gh release delete ${{ env.tag_preview }} --cleanup-tag --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update the PDF preview
uses: Xotl/cool-github-releases@v1
with:
mode: update
isPrerelease: true
tag_name: auto-pdf-preview
release_name: "Auto PDF Preview"
body_mrkdwn: |
This release aims to provide a PDF preview of the last commit applied on this repository.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload the new PDF preview
run: |
RELEASE_NOTES="This release aims to provide a PDF preview of the last commit applied on this repository.
It will be updated automatically after each merge of a PullRequest.
**DO NOT PUBLISH THIS PRE-RELEASE!**"
_Corresponding commit: ${{ github.sha }}_
assets: ${{ env.doc_name }}-draft.pdf
replace_assets: true
github_token: ${{ secrets.GITHUB_TOKEN }}
**DO NOT PUBLISH THIS PRE-RELEASE!**
_Corresponding commit: ${{ github.sha }}_"

gh release create ${{ env.tag_preview }} \
${{ env.doc_name }}-draft.pdf \
--prerelease \
--target "${{ env.branch_name }}" \
--title 'Auto PDF Preview' \
--notes "$RELEASE_NOTES"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}