Skip to content

Commit

Permalink
feat: add python problem matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Jul 19, 2023
1 parent be9daaa commit ea45518
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 8 deletions.
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
}
]
}
]
}
8 changes: 4 additions & 4 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 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()

0 comments on commit ea45518

Please sign in to comment.