From d4244ac15cc1748a0c83b6875bdd161528840d86 Mon Sep 17 00:00:00 2001 From: MikeMwita Date: Sat, 23 Mar 2024 19:05:08 +0300 Subject: [PATCH 1/2] Add a contributing guide --- CONTRIBUTING.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3822ead --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,80 @@ + +# Contributing to African's Talking Go SDK + +We welcome contributions from the community! If you'd like to contribute to the African's Talking Go SDK, please follow these guidelines. + +## Setting Up Your Environment + +Before you can contribute, you need to set up your development environment. Here's how you can do it: + +1. **Fork the Repository** + - Go to the [African's Talking Go SDK repository](https://github.com/MikeMwita/africastalking-go). + - Click on the "Fork" button in the top-right corner of the page and clone your fork. + + +3. **Install Dependencies** + - Navigate to the cloned repository directory in your terminal. + - Run the following command to install the necessary dependencies: + ```bash + go mod tidy + ``` + +4. **Create a New Branch** + - Create a new branch for your feature or bug fix: + ```bash + git checkout -b your-branch-name + ``` + - Replace `your-branch-name` with a descriptive name for your branch. + +## Making Changes + +1. **Make Your Changes** + - Open the project in your favorite IDE or editor. + - Make your changes to the codebase. + +2. **Write Tests** + - Add tests that cover the changes you've made. + - Ensure all tests pass by running: + ```bash + go test -cover ./... + ``` + +3. **Document Your Changes** + - Update the `README.md` if necessary. + - Add comments to your code where appropriate. + +4. **Commit Your Changes** + - Stage your changes for commit: + ```bash + git add . + ``` + - Commit your changes with a descriptive message: + ```bash + git commit -m "Add a brief description of your changes" + ``` + +5. **Push to Your Fork** + - Push your changes to your fork on GitHub: + ```bash + git push origin your-branch-name + ``` + +## Submitting a Pull Request + +1. **Open a Pull Request** + - Click on "Pull requests" and then the "New pull request" button. + - Choose your fork and branch as the source and the original repository's main branch as the target. + - Fill in the pull request template with information about your changes. + +2. **Code Review** + - Wait for the maintainers to review your pull request. + - Make any requested changes. + +3. **Merge** + - Once your pull request is approved, the maintainers will merge it into the main codebase. + +Thank you for contributing to the African's Talking Go SDK! + +--- + + Happy coding! 🚀 \ No newline at end of file From 9683e3543e05b8a2ee60fd7cc844309e2e5f0e9b Mon Sep 17 00:00:00 2001 From: MikeMwita Date: Sat, 23 Mar 2024 19:05:36 +0300 Subject: [PATCH 2/2] Update CI workflow --- .github/workflows/ci.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 28d9b5d..e87be19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,15 +2,15 @@ name: Continuous Integration on: pull_request: - branches: [main] + branches: [master] push: - branches: [main] + branches: [master] jobs: build-across-platforms: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -61,10 +61,16 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Run tests + - name: Run Unit tests run: | - make test - + go test -race -covermode atomic -coverprofile=covprofile ./... - name: Install goveralls run: go install github.com/mattn/goveralls@latest + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: goveralls -coverprofile=covprofile -service=github + + +