Improve test usage and clarity #16
Workflow file for this run
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: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
workflow_dispatch: | |
jobs: | |
directory: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Test on affected directory | |
uses: ./ | |
with: | |
directory: "tests/directory/affected/*" | |
- name: Assert not affected result does not exist | |
run: | | |
! test -e tests/directory/not-affected/main.min.js | |
- name: Assert affected result matches expected | |
run: | | |
git diff --exit-code --no-index \ | |
tests/directory/affected/main.expected.js \ | |
tests/directory/affected/main.min.js | |
overwrite: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Test overwrite | |
uses: ./ | |
with: | |
directory: "tests/overwrite/*" | |
overwrite: true | |
- name: Assert overwrite result matches expected | |
run: | | |
git diff --exit-code --no-index \ | |
tests/overwrite/main.expected.js \ | |
tests/overwrite/main.js |