Result ingestion pipeline fails due to missing pdf generation dependency packages #88
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: Import results from issue | |
on: | |
workflow_dispatch: | |
issues: | |
types: [opened, edited] | |
issue_comment: | |
types: [created, edited] | |
jobs: | |
run: | |
if: (github.event.issue.state == 'open') && !github.event.issue.locked | |
name: Import results | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout benchmarks repository | |
uses: actions/checkout@v3 | |
- name: Download import-results binary | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
repo: ${{ format('{0}-ci', github.repository) }} | |
workflow: ci.yml | |
branch: main | |
- name: Set import-results binary permissions | |
run: | | |
chmod +x iocost-benchmarks-ci/import-results | |
- name: Download resctl-demo binary | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
repo: ${{ format('{0}-ci', github.repository) }} | |
workflow: build-resctl-demo.yml | |
branch: main | |
- name: Set resctl-demo permissions | |
run: | | |
chmod +x resctl-demo-v*/* | |
- name: Smoketest resctl-demo | |
run: | | |
resctl-demo-v2.1/resctl-bench --version | |
resctl-demo-v2.2/resctl-bench --version | |
- name: Install PDF formatting dependencies and fix config | |
run: | | |
mkdir -p ~/.fonts/adobe-fonts | |
git clone https://github.com/adobe-fonts/source-code-pro.git ~/.fonts/adobe-fonts/source-code-pro | |
fc-cache -f -v ~/.fonts/adobe-fonts/source-code-pro | |
sudo apt install inkscape ghostscript | |
sudo sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml | |
- name: Run import-results | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
ISSUE_NUMBER: ${{ github.event.issue.number }} | |
run: | | |
iocost-benchmarks-ci/import-results | |
if git rev-parse --verify iocost-bot/${ISSUE_NUMBER}; then echo DID_IMPORT=1 >> $GITHUB_ENV; else echo DID_IMPORT=0 >> $GITHUB_ENV; fi | |
- name: Push to git | |
if: env.DID_IMPORT == '1' | |
env: | |
ISSUE_NUMBER: ${{ github.event.issue.number }} | |
run: | | |
git push -f origin iocost-bot/${ISSUE_NUMBER} | |
echo 'BRANCH_NAME<<EOF' >> $GITHUB_ENV | |
echo iocost-bot/${ISSUE_NUMBER} >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- name: PR title | |
if: env.DID_IMPORT == '1' | |
run: | | |
echo 'PR_TITLE<<EOF' >> $GITHUB_ENV | |
git log --pretty='format:%s%n' ${{ env.BRANCH_NAME }}^..${{ env.BRANCH_NAME }} >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- name: PR body | |
if: env.DID_IMPORT == '1' | |
run: | | |
echo 'PR_BODY<<EOF' >> $GITHUB_ENV | |
git log --pretty='format:%b%n' ${{ env.BRANCH_NAME }}^..${{ env.BRANCH_NAME }} >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- name: Pull request | |
if: env.DID_IMPORT == '1' | |
run: gh pr edit ${{ env.BRANCH_NAME }} -b '${{ env.PR_BODY }}' -t '${{ env.PR_TITLE }}' && gh pr reopen ${{ env.BRANCH_NAME }} || gh pr create --fill -B main -H ${{ env.BRANCH_NAME }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Upload PDFs | |
if: env.DID_IMPORT == '1' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PDFs | |
if-no-files-found: error | |
path: | | |
${{ format('pdfs-for-{0}', github.event.issue.number) }} | |
- name: Update issue with a link | |
if: env.DID_IMPORT == '1' | |
run: | | |
echo ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
gh issue comment -b "You can find the PDFs for the new merges here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" ${{ github.event.issue.number }} | |
env: | |
GH_TOKEN: ${{ github.token }} |