-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |