Skip to content
Merged
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
63 changes: 61 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,45 @@ on:
pull_request:
workflow_dispatch:

# Install StructKit via the published major tag. v0 exists on
# httpdss/structkit-setup (same commit as v0.0.1).
permissions:
contents: read
actions: write

jobs:
test-requires-structkit-on-path:
name: Test Requires StructKit on PATH
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Run without StructKit
id: missing
continue-on-error: true
uses: ./
with:
command: validate

- name: Expect PATH error
run: |
if [[ "${{ steps.missing.outcome }}" != "failure" ]]; then
echo "Expected the action to fail when structkit is not on PATH"
exit 1
fi
echo "Missing structkit failed as expected"

test-validate:
name: Test Validate Command
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Create test structure file
run: |
cat > .structkit.yaml << 'EOF'
Expand All @@ -35,6 +66,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Create test structure file
run: |
cat > .structkit.yaml << 'EOF'
Expand Down Expand Up @@ -64,6 +98,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Create test structure file
run: |
cat > .structkit.yaml << 'EOF'
Expand Down Expand Up @@ -94,6 +131,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit from git
uses: httpdss/structkit-setup@v0
with:
structkit-version: "https://github.com/httpdss/structkit.git@main"

- name: Create test structure file
run: |
cat > .structkit.yaml << 'EOF'
Expand All @@ -102,12 +144,11 @@ jobs:
content: "Testing version"
EOF

- name: Run with git installation
- name: Run with git-installed StructKit
uses: ./
with:
command: validate
struct_file: .structkit.yaml
structkit_version: "https://github.com/httpdss/structkit.git@main"

test-validate-structkit-yaml-fixture:
name: Test Validate .structkit.yaml Fixture
Expand All @@ -116,6 +157,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Run validate with .structkit.yaml fixture
uses: ./
with:
Expand All @@ -129,6 +173,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Run validate with legacy .struct.yaml fixture
uses: ./
with:
Expand All @@ -142,6 +189,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Place .structkit.yaml at repo root
run: cp tests/fixtures/structkit-yaml/.structkit.yaml .structkit.yaml

Expand All @@ -157,6 +207,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Place legacy .struct.yaml at repo root
run: cp tests/fixtures/legacy-struct-yaml/.struct.yaml .struct.yaml

Expand All @@ -172,6 +225,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Place both default files at repo root
run: |
cp tests/fixtures/structkit-yaml/.structkit.yaml .structkit.yaml
Expand All @@ -189,6 +245,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v7

- name: Set up StructKit
uses: httpdss/structkit-setup@v0

- name: Run validate without config
id: validate
continue-on-error: true
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

All notable changes to this project are documented in this file.

## Unreleased

### Breaking changes

- **This action no longer installs Python or StructKit.** It expects `structkit` to already be on `PATH`.
- Removed inputs `structkit_version` and `python_version`.
- Call [`httpdss/structkit-setup`](https://github.com/httpdss/structkit-setup) first when you need StructKit installed:

```yaml
- uses: httpdss/structkit-setup@v0
- uses: httpdss/structkit-action@v0
with:
command: validate
```

If `structkit` is missing, the action fails with an error that points at `uses: httpdss/structkit-setup@v0`.
- Docs, examples, and CI pin the published major tags `@v0` (`httpdss/structkit-setup@v0`, then `httpdss/structkit-action@v0`). Show `structkit-version` on setup when you need a specific StructKit release.

### License

- Relicensed from MIT to Apache License 2.0.
Loading
Loading