Fix workflow #26
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: Test | ||
on: [pull_request, workflow_dispatch] | ||
jobs: | ||
spelling: | ||
name: Spelling is correct | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
- name: Install hunspell | ||
run: sudo apt-get -y install hunspell hunspell-en-gb | ||
- name: Spell Check | ||
run: cicd/Spelling.sh | ||
shell: bash --noprofile --norc -eo pipefail -o nounset {0} | ||
build_pdf: | ||
name: Can create PDF | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
- name: Get Current Date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
- name: Get Githash | ||
id: git_hash | ||
run: echo "::set-output name=git_hash::$(git rev-parse --short "$GITHUB_SHA")" | ||
- name: Get Git Branch | ||
id: git_branch | ||
run: echo "::set-output name=git_branch::${GITHUB_REF#refs/heads/}" | ||
- name: Set Version in Document | ||
uses: jacobtomlinson/gha-find-replace@v2 | ||
with: | ||
find: "@@version@@" | ||
replace: "${{ steps.date.outputs.date }}-${{ steps.git_branch.outputs.git_branch }}-${{ steps.git_hash.outputs.git_hash }}" | ||
regex: false | ||
- name: Compile LaTeX Document | ||
uses: xu-cheng/latex-action@v2 | ||
with: | ||
root_file: rb-cv.tex | ||
- name: Upload Artefact | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: rb-cv.pdf | ||
path: ./rb-cv.pdf | ||
two_pages: | ||
name: Is less than two pages | ||
needs: build_pdf | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
- name: Download Artifact | ||
uses: actions/download-artifact@master | ||
with: | ||
name: rb-cv.pdf | ||
path: ./ | ||
- name: Install pdfinfo | ||
run: sudo apt-get install poppler-utils | ||
- name: Length of Document Check | ||
run: cicd/Length.sh | ||
shell: bash --noprofile --norc -eo pipefail -o nounset {0} | ||
can_create_thumbnail: | ||
name: Can create thumbnail | ||
needs: build_pdf | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v2 | ||
- name: Download Artifact | ||
uses: actions/download-artifact@master | ||
with: | ||
name: rb-cv.pdf | ||
path: ./ | ||
- name: Run convert command | ||
run: cat /etc/ImageMagick-6/policy.xml | ||
run: convert -density 700 -resize 10% -append -quality 98 -alpha remove rb-cv.pdf rb-cv-thumbnail-p1.jpg | ||