|
1 | 1 | # voice-controlled-task-manager |
2 | 2 | A voice controlled to-do list - allows you to add, check off or delete tasks using voice command |
| 3 | + |
| 4 | +## Continuous Integration |
| 5 | + |
| 6 | +This repository uses GitHub Actions for continuous integration. The workflow is defined in the `.github/workflows/main.yml` file and includes the following steps: |
| 7 | + |
| 8 | +- **Checkout repository**: This step uses the `actions/checkout` action to clone the repository code into the runner. |
| 9 | +- **Set up Node.js**: This step uses the `actions/setup-node` action to set up the Node.js environment based on the specified version. |
| 10 | +- **Install dependencies**: This step runs `npm install` to install all the dependencies listed in the `package.json` file. |
| 11 | +- **Run tests**: This step runs `npm test` to execute the tests defined in your project. |
| 12 | + |
| 13 | +### What is a .yml file? |
| 14 | + |
| 15 | +A `.yml` file, also known as a YAML file, is a human-readable data serialization standard that is often used for configuration files. In the context of GitHub Actions, `.yml` files are used to define workflows, which specify a series of steps to be executed on specified events, such as code pushes or pull requests. |
| 16 | + |
| 17 | +### How to Set Up the Workflow |
| 18 | + |
| 19 | +1. **Create a new workflow file**: Navigate to the `.github/workflows/` directory in your repository and create a new file named `main.yml`. |
| 20 | +2. **Define the workflow**: Add the following content to the `main.yml` file: |
| 21 | + |
| 22 | +```yaml |
| 23 | +name: CI |
| 24 | + |
| 25 | +on: |
| 26 | + push: |
| 27 | + branches: |
| 28 | + - main |
| 29 | + pull_request: |
| 30 | + branches: |
| 31 | + - main |
| 32 | + |
| 33 | +jobs: |
| 34 | + build: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v2 |
| 40 | + |
| 41 | + - name: Set up Node.js |
| 42 | + uses: actions/setup-node@v2 |
| 43 | + with: |
| 44 | + node-version: '14' |
| 45 | + |
| 46 | + - name: Install dependencies |
| 47 | + run: npm install |
| 48 | + |
| 49 | + - name: Run tests |
| 50 | + run: npm test |
| 51 | +Commit the changes: Commit the new workflow file to the repository. This will trigger the workflow on every push and pull request to the main branch. |
| 52 | +By following these steps, you set up a continuous integration workflow that helps automate the process of testing your code whenever changes are made. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +To test, rigger the Workflow Manually: |
| 57 | + |
| 58 | +Make a small change in your repository (e.g., update the README.md file) and commit the changes to the main branch. This will trigger the workflow as defined by the on: push event in the main.yml file. |
| 59 | +Check the Workflow Status: |
| 60 | + |
| 61 | +Go to the Actions tab in your repository. |
| 62 | +You should see the workflow run listed there. Click on it to view the details and check if all steps have completed successfully. |
| 63 | +Review the Logs: |
| 64 | + |
| 65 | +Click on the specific run to see the logs for each step. Ensure that all steps (checkout, setup Node.js, install dependencies, and run tests) completed without errors. |
| 66 | +If everything runs successfully, your workflow is set up correctly. If there are error |
0 commit comments