Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Jul 28, 2022
1 parent 5ca2941 commit 3c75f4f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,20 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run build
run: make build

- name: Test action
uses: ./
with:
bin_path: ./bin/auto_doc

- name: Run auto-doc using the test directory
run:
make test
run: make test

- name: Run auto-doc using the top level directory
run:
make run
run: make run

- name: Format markdown
uses: tj-actions/remark@v3
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Add the `Inputs` and/or `Outputs` [`H2` header](https://github.com/adam-p/markdo
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|----------------|--------|----------|----------------|---------------------------------------------|
| action | string | false | `"action.yml"` | Path to the action.yml file<br> |
| bin_path | string | false | | Path to the binary |
| col_max_width | string | false | `"1000"` | Max width of a column<br> |
| col_max_words | string | false | `"5"` | Max number of words per<br>line in a column |
| input_columns | string | false | | List of Input columns |
Expand Down
13 changes: 10 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ inputs:
output_columns:
description: 'List of Output columns'
required: false
bin_path:
description: 'Path to the binary'
required: false

runs:
using: 'composite'
steps:
- run: |
EXTRA_ARGS=""
BIN_PATH="${{ inputs.bin_path }}"
for input_column in "${{ join(inputs.input_columns, ' ') }}"; do
EXTRA_ARGS="${EXTRA_ARGS} --inputColumns ${input_column}"
Expand All @@ -38,10 +42,13 @@ runs:
for output_column in "${{ join(inputs.output_columns, ' ') }}"; do
EXTRA_ARGS="${EXTRA_ARGS} --outputColumns ${output_column}"
done

if [ -z "$BIN_PATH" ]; then
curl -sf https://gobinaries.com/github.com/tj-actions/auto-doc | PREFIX=. sh
BIN_PATH="./auto-doc"
fi

curl -sf https://gobinaries.com/github.com/tj-actions/auto-doc | PREFIX=. sh

./auto-doc --action="${{ inputs.action }}" --output="${{ inputs.output }}" \
$BIN_PATH --action="${{ inputs.action }}" --output="${{ inputs.output }}" \
--colMaxWidth="${{ inputs.col_max_width }}" --colMaxWords="${{ inputs.col_max_words }}" \
${EXTRA_ARGS} && exit_status=$? || exit_status=$?

Expand Down

0 comments on commit 3c75f4f

Please sign in to comment.