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

CI TEST COMMIT #1

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
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
33 changes: 33 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on: [push, pull_request, workflow_dispatch]

jobs:
run-tests:
if: github.repository_owner == 'olemorud'

permissions:
contents: read

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: npm install
run: npm ci

- name: Run unit tests
run: npm run test

- name: Apply problem matcher
uses: ./
with:
build-directory: ""

- name: Test problem matcher
run: |
ls
cat dist/gcc_matcher.json
cp -r test build
gcc -Wall -Wextra -O0 build/generate_warnings.c
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
*/gcc_matcher.json
*/a.out
.vscode/
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# GCC problem matcher

# DO NOT COMMIT THIS LINE

Creates annotations for warnings and errors in gcc builds.

## Inputs

### root

**Optional** Base directory for build. For builds done in a subdirectory, this should match that directory, otherwise the pattern match will not be able to point to the correct file.

## Usage
## Example usage

Just add a single line before running the build step.
Just add this line anywhere before running the build step.

```yaml
- uses: olemorud/gcc-problem-matcher@master
```
with:
root: /workspace/build
```
7 changes: 3 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ branding:
color: yellow

inputs:
root:
build-directory:
description: 'base directory for build, e.g. /workdir/build'
required: false
default: ''
required: true

runs:
using: 'node16'
main: 'src/index.js'
main: 'dist/index.js'
17 changes: 17 additions & 0 deletions dist/gcc_matcher.jsontemplate
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "gcc-problem-matcher",
"pattern": [
{
"regexp": "^\\s*${{ BASE }}\/?(.*?):(\\d+):(\\d+):.*?(warning|error): (.*)$"
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}
Loading