Skip to content

Commit

Permalink
Fix requirements.txt path, create executable file for ghchecks and up…
Browse files Browse the repository at this point in the history
…date swifty-code-coverage (#19)
  • Loading branch information
michaelhenry authored Oct 30, 2022
1 parent da1dee6 commit 21e12c9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- run: pip install -r requirements.txt
shell: bash
- run: swift test --enable-code-coverage
- uses: michaelhenry/[email protected].0
- uses: michaelhenry/[email protected].1
with:
build-path: .build
target: GithubChecksPackageTests.xctest
Expand All @@ -49,7 +49,7 @@ jobs:
- run: pip install -r requirements.txt
shell: bash
- run: swift test --enable-code-coverage
- uses: michaelhenry/[email protected].0
- uses: michaelhenry/[email protected].1
with:
build-path: .build
target: GithubChecksPackageTests.xctest
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
## Using Markdown
```yml
- uses: michaelhenry/create-report@v2.0.0
- uses: michaelhenry/create-report@v2
name: create report from markdown
with:
title: "Markdown report"
Expand All @@ -41,7 +41,7 @@ Please see [samples/sample.md](samples/sample.md) for the sample file which gene
## Using HTML
```yml
- uses: michaelhenry/create-report@v2.0.0
- uses: michaelhenry/create-report@v2
name: create report from html
with:
title: "HTML report"
Expand All @@ -58,7 +58,7 @@ Please see [samples/sample.html](samples/sample.html) for the sample file which
## Using JUnit
```yml
- uses: michaelhenry/create-report@v2.0.0
- uses: michaelhenry/create-report@v2
name: create report from junit
with:
title: "JUnit report"
Expand Down
22 changes: 18 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ runs:
steps:
- name: Cache Pip
id: pip-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-hashFiles("**/requirements.txt")-v1
key: ${{ runner.os }}-${{ env.GITHUB_ACTION_PATH }}-pip-cache

- uses: fwal/[email protected]
with:
Expand All @@ -37,13 +37,27 @@ runs:
python-version: '3.8.12'
cache: 'pip'

- run: pip install -r requirements.txt
- run: pip install -r $GITHUB_ACTION_PATH/requirements.txt
if: steps.pip-cache.outputs.cache-hit != 'true'
shell: bash

- name: Cache ghchecks
id: ghchecks-cache
uses: actions/cache@v3
with:
path: /usr/local/bin/ghchecks
key: ${{ runner.os }}-${{ env.GITHUB_ACTION_PATH }}-ghchecks-cache

- if: steps.ghchecks-cache.outputs.cache-hit != 'true'
run: |
cd $GITHUB_ACTION_PATH
swift build -c release && \
cp .build/release/ghchecks /usr/local/bin/ghchecks
shell: bash

- name: Create report
run: |
swift run ghchecks create-report \
ghchecks create-report \
--title "${{ inputs.title }} " \
--path "${{ inputs.path }}" \
--format "${{ inputs.format }}" \
Expand Down

0 comments on commit 21e12c9

Please sign in to comment.