Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./
with:
search-paths: test/good.json test/good.yaml test/good.toml test/good.xml test/good.ini
search-paths: test/good.json test/good.yaml test/good.toml test/good.xml test/good.ini test/justfile

# Validate that bad files cause a non-zero exit
test-failing-files:
Expand Down Expand Up @@ -206,3 +206,47 @@ jobs:
echo "Expected validation to fail when schema is required but not declared"
exit 1
fi

# Embedded schemastore with remote fetching
test-schemastore:
name: "Test: schemastore (embedded)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./
with:
search-paths: test/good.json
schemastore: "true"

# Validate only changed files
test-only-changed:
name: "Test: only-changed"
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: ./
with:
only-changed: "true"

# Verify outputs are set
test-outputs:
name: "Test: outputs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./
id: validate
with:
search-paths: test/good.json
- name: Verify outputs
run: |
if [ -z "${{ steps.validate.outputs.files-validated }}" ]; then
echo "Missing files-validated output"
exit 1
fi
echo "files-validated=${{ steps.validate.outputs.files-validated }}"
echo "files-failed=${{ steps.validate.outputs.files-failed }}"
echo "exit-code=${{ steps.validate.outputs.exit-code }}"
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ COPY cmd/ cmd/
RUN CGO_ENABLED=0 go build -ldflags='-w -s' -o /entrypoint cmd/entrypoint/main.go

FROM alpine:3.23@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
RUN apk --no-cache add git
COPY --from=builder /entrypoint /entrypoint
RUN chmod 0755 /entrypoint
WORKDIR /github/workspace
Expand Down
Loading