From aa410e12e5e498398961c6aa81370a7234dec694 Mon Sep 17 00:00:00 2001 From: Mohamed Elashri Date: Thu, 21 Sep 2023 14:14:52 -0400 Subject: [PATCH] Write action documentation --- README.md | 117 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 95 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index d9a584e..98526e9 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ## Overview -This GitHub Action allows you to run a ROOT CERN script for high-energy physics analysis. The action sets up the ROOT environment, runs the specified ROOT script, and verifies the existence of an output file. +This GitHub Action allows you to run a ROOT CERN script for different purposes. The action sets up the ROOT environment, runs the specified ROOT script, and verifies the existence of an output file. -## Inputs +## Action Inputs ### `root_script` @@ -12,7 +12,7 @@ This GitHub Action allows you to run a ROOT CERN script for high-energy physics ### `output_file` -**Required**: The name of the output file to check for after the ROOT script has been executed. Provide the filename as a string, for example, `'output.png'`. +**Optional**: The name of the output file to check for after the ROOT script has been executed. Provide the filename as a string, for example, `'output.png'`. If no output file is expected, this parameter can be omitted. ## Usage @@ -20,43 +20,116 @@ Add a step in your GitHub Actions workflow YAML file to use this action: ```yaml - name: Run ROOT CERN Script Action - uses: MohamedElashri/rootcern-action@1.1 + uses: MohamedElashri/rootcern-action@1.0 with: - root_script: 'test_root_script.C' - output_file: 'test_root_output.png' + scripts: 'test_root_script.C' + output_files: 'test_root_output.png' ``` -## Example Workflow +## Examples -Here is a full example of a workflow +### Example 1: Running a single script with no output file ```yaml -name: test root +name: ROOT CI, Single without output on: push: - branches: - - main + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: jobs: - example: - runs-on: ubuntu-latest + test: + runs-on: ubuntu-20.04 steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Run ROOT CERN Script - uses: MohamedElashri/rootcern-action@1.1 + - uses: actions/checkout@v2 + + - name: Run ROOT CERN scripts + uses: your-github-username/your-action-repo@main with: - root_script: 'test_root_script.C' - output_file: 'test_root_output.png' + scripts: test_root_script1.C ``` -### `output_file` +### Example 2: Running a single script with an output file -**Optional**: The name of the output file to check for after the ROOT script has been executed. Provide the filename as a string, for example, `'output.png'`. If no output file is expected, this parameter can be omitted. +```yaml +name: ROOT CI, Single with output + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Run ROOT CERN scripts + uses: MohamedElashri/rootcern-action@1.0 + with: + scripts: test_root_script1.C + output_files: test_root_output1.png +``` + +### Example 3: Running multiple scripts with output files + +```yaml +name: ROOT CI, multiple scripts with output files + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Run ROOT CERN scripts + uses: MohamedElashri/rootcern-action@1.0 + with: + scripts: test_root_script1.C,test_root_script2.C + output_files: test_root_output1.png,test_root_output2.png +``` + + +## License + +This project is licensed under the GNU General Public License, version 3.0 (GPL-3.0). You can find the full text of the license [here](https://github.com/MohamedElashri/rootcern-action/blob/main/LICENSE) + +## Contributions + +I welcome contributions to this project! If you have any ideas for improvements, bug fixes, or new features, please feel free to submit a pull request. + +Here are some tips for contributing to this project: + +Here are some ways you can contribute to this project: + +* Submit bug reports and feature requests. +* Write code, tests, and documentation. +* Review and improve existing code. +* Help promote the project to others. + +In general you should follow these guidlines. +* Make sure your contributions are well-tested and documented. +* Follow the project's coding style guide. +* Add a comment to your pull request explaining what your changes do. +* Be respectful and considerate of other contributors. +I appreciate your contributions to this project!