Skip to content

Commit e64ee19

Browse files
committed
ci: add workflow to test action and support local pacta install option
1 parent 9fabb42 commit e64ee19

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

.github/workflows/test-action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test Pacta Composite Action
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Check jq
20+
run: jq --version
21+
22+
- name: Run action (default inputs)
23+
uses: ./
24+
with:
25+
model: architecture.yml
26+
rules: rules.pacta.yml
27+
fail-on-violations: "false"
28+
pacta-version: "local"

action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inputs:
2626
required: false
2727
default: 'true'
2828
pacta-version:
29-
description: 'Pacta version to install (default: latest)'
29+
description: 'Pacta version to install (PyPI spec, default: pacta)'
3030
required: false
3131
default: 'pacta'
3232

@@ -39,7 +39,12 @@ runs:
3939

4040
- name: Install Pacta
4141
shell: bash
42-
run: pip install ${{ inputs.pacta-version }}
42+
run: |
43+
if [ "${{ inputs.pacta-version }}" = "local" ]; then
44+
pip install .
45+
else
46+
pip install "${{ inputs.pacta-version }}"
47+
fi
4348
4449
- name: Run Architecture Check
4550
id: pacta

0 commit comments

Comments
 (0)