Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add python problem matchers #16

Merged
merged 2 commits into from
Jul 19, 2023
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
18 changes: 18 additions & 0 deletions .github/python.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Install specific version
uses: ./
with:
version: '0.9.0'
version: '0.11.0'
- run: |
which rye
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Set up your GitHub Actions workflow with a specific version of [rye](https://rye-up.com/).

* Install a version of rye and add it to the path
* Cache the installed version of rye to speed up consecutive runs on self-hosted runners
* Register problem matchers for error output

## Limitations

1. Currently only linux is supported see [issue #10](https://github.com/eifinger/setup-rye/issues/10)
Expand All @@ -10,12 +14,8 @@ Set up your GitHub Actions workflow with a specific version of [rye](https://rye
## Usage

```yaml
- name: Checkout your repository
uses: actions/checkout@v3
- name: Install the latest version of rye
uses: eifinger/setup-rye@v1
- name: Sync your dependencies
run: rye sync
```

You can also specify a specific version of rye
Expand All @@ -24,7 +24,7 @@ You can also specify a specific version of rye
- name: Install a specific version
uses: eifinger/setup-rye@v1
with:
version: '0.10.0'
version: '0.11.0'
```

## How it works
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/37.index.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/setup/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript-action",
"version": "0.0.0",
"name": "setup-rye",
"version": "1.1.0",
"private": true,
"description": "TypeScript template action",
"main": "dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions src/setup-rye.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function run(): Promise<void> {
cachedPath = await setupRye(platform, arch, version)
}
addRyeToPath(cachedPath)
addMatchers()
} catch (err) {
core.setFailed((err as Error).message)
}
Expand Down Expand Up @@ -142,4 +143,9 @@ function addRyeToPath(cachedPath: string): void {
core.info(`Added ${cachedPath}/shims to the path`)
}

function addMatchers(): void {
const matchersPath = path.join(__dirname, '../..', '.github')
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`)
}

run()