Test action #64
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 action | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- .github/workflows/test.yml | |
- action.yml | |
pull_request: | |
types: [ opened, synchronize, reopened ] # Same as default | |
paths: | |
- .github/workflows/test.yml | |
- action.yml | |
workflow_run: | |
workflows: [ Docker build ] | |
types: [ completed ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test expect to match | |
uses: ./ | |
with: | |
file1: test/expected.pdf | |
file2: test/actual.pdf | |
options: --verbose | |
- name: Test no options | |
uses: ./ | |
with: | |
file1: test/expected.pdf | |
file2: test/actual.pdf | |
- name: Test view the difference | |
uses: ./ | |
with: | |
file1: test/a.pdf | |
file2: test/b.pdf | |
options: --skip-identical --output-diff=test/diff.pdf --dpi=100 | |
suppress-diff-error: true | |
- name: Generate diff rendered in Japanese font with Re:VIEW | |
uses: ./ | |
with: | |
file1: test/review_japanese_1.pdf | |
file2: test/review_japanese_2.pdf | |
options: --output-diff=test/review_japanese_diff.pdf | |
suppress-diff-error: true | |
- name: Verify diff rendered in Japanese font with Re:VIEW | |
uses: ./ | |
with: | |
file1: test/review_japanese_diff_expected.pdf | |
file2: test/review_japanese_diff.pdf | |
options: --verbose | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Output diff PDFs | |
path: test/*diff.pdf | |
if: always() | |
test-on-container: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
container: | |
image: ghcr.io/nowsprinting/diff-pdf:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: diff-pdf --verbose test/expected.pdf test/actual.pdf | |
notify: | |
needs: [ test, test-on-container ] | |
if: failure() | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
steps: | |
- uses: Gamesight/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} |