Skip to content

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jidicula authored Oct 23, 2021
1 parent 2dfefc0 commit 4eaa3fa
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
# Testing your contribution:

You can clone [jidicula/test-clang-format-action](https://github.com/jidicula/test-clang-format-action) and modify the GitHub Actions workflow to point to your clone and your branch:
e.g.

```yaml
name: clang-format Check
on:
push:
workflow_dispatch:
jobs:
formatting-check:
name: Formatting Check
strategy:
matrix:
path:
- check: 'known_fail'
exclude: 'capi'
- check: 'known_pass'
exclude: 'capi'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++ programs.
uses: yourusername/clang-format-action@your-branch-name # modify this to point to your fork and feature branch!
with:
check-path: ${{ matrix.path['check'] }}
clang-format-version: 13
exclude-regex: ${{ matrix.path['exclude'] }}
```
Then you can set up test cases as needed in the test repo, and work on your patch in your clone of `clang-format-action` - each time you want to re-run your test workflow, you can use the workflow dispatch trigger.

Alternatively, you can modify your own repo that you intend to use with this Action to point to your fork and feature branch to make sure it works well.
The GitHub Actions [Build and Test workflow](https://github.com/jidicula/clang-format-action/actions/workflows/dockerimage.yml) is triggered on PR submission. It runs [`test/docker-run-test.sh`](https://github.com/jidicula/clang-format-action/blob/main/test/docker-run-test.sh) on the [test files](https://github.com/jidicula/clang-format-action/tree/main/test). Run this script locally to test your changes. If you're adding checking functionality for new file extensions, add test files that are known to pass this Action's check and known to fail this Action's check, in `test/known_pass` and `test/known_fail` respectively.

0 comments on commit 4eaa3fa

Please sign in to comment.