YAML + REGEX #171
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: acceptance-test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Need to checkout for testing the Action in this repo | |
- uses: actions/checkout@v4 | |
# creates invalid files that are excluded by git and should not fail | |
- name: invalid file creation | |
run: | | |
mkdir -p tmp/ | |
echo "invalid: yaml" > tmp/invalid.yaml | |
echo "invalid: json" > tmp/invalid.json | |
# creates a valid file that should not fail | |
- name: valid file creation | |
run: echo "{}" > valid.yaml | |
- name: acceptance test | |
uses: ./ | |
id: json-yaml-validate | |
with: | |
comment: "true" | |
exclude_file: .github/config/exclude.txt | |
- name: acceptance test - files input option (glob) | |
uses: ./ | |
id: json-yaml-validate-glob-test | |
with: | |
comment: "true" | |
yaml_as_json: "false" | |
exclude_file: .github/config/exclude-alt.txt | |
files: | | |
__tests__/**/test1.yml | |
__tests__/**/test*.json | |
- name: acceptance test - custom formats | |
uses: ./ | |
id: json-yaml-validate-custom-formats-test | |
with: | |
comment: "true" | |
json_schema: ./__tests__/fixtures/schemas/schema_with_custom_ajv_regexp_format.json | |
ajv_custom_regexp_formats: | | |
lowercase_char=^[a-z]*$ | |
lowercase_alphanumeric=^[a-z0-9]*$ | |
files: | | |
__tests__/fixtures/json/custom_ajv_regexp_format/valid.json | |
- name: acceptance test - flat yaml | |
uses: ./ | |
id: json-yaml-validate-flat-yaml-test | |
with: | |
comment: "true" | |
yaml_schema: ./__tests__/fixtures/schemas/flat.yaml | |
files: | | |
__tests__/acceptance/flat_yaml/flat.yaml | |
- name: acceptance test - regex yaml | |
uses: ./ | |
id: json-yaml-validate-regex-yaml-test | |
with: | |
comment: "true" | |
yaml_schema: ./__tests__/fixtures/schemas/regex.yaml | |
files: | | |
__tests__/acceptance/regex/regex.yaml |