Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Example Usages to Readme #32

Merged
merged 2 commits into from
Apr 24, 2024
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,39 @@ Compile and test solutions to [LeetCode](https://leetcode.com/) problems on GitH
| ------- | ---------------- | ---------------------------------------------------------------------------------- |
| `files` | Multiple strings | A list of pattern for solution files to process. It defaults to `**/solution.cpp`. |

## Example Usages

This example demonstrates how to use this action to compile and test solutions to LeetCode problems in a GitHub Actions workflow:

```yaml
name: Test
on:
push:
jobs:
test-solutions:
name: Test Solutions
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.4

- name: Test Solutions
uses: threeal/leettest-action@v0.2.0
```

### Testing Specific Solution Files

By default, this action tests all solution files in the current working directory. To specify the solution files to test, set the `files` input:

```yaml
- name: Test Solutions
uses: threeal/leettest-action@v0.2.0
with:
files: |
problems/2235/solution.cpp
other-problems/**/solution.cpp
```

## License

This project is licensed under the terms of the [MIT License](./LICENSE).
Expand Down
Loading