From a8463729ec2429864a16908ceda8dda010b2959c Mon Sep 17 00:00:00 2001 From: Misha Merkushin Date: Mon, 26 Feb 2024 16:52:43 +0300 Subject: [PATCH] feat: add github ci --- .github/ISSUE_TEMPLATE/bug_report.md | 31 +++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 24 +++++++++++++ .github/workflows/tests.yml | 50 ++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/tests.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..d6868e2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Provide kafka_producer.yml config +2. Run command +3. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Context (please complete the following information):** + - Ruby version + - Rails version + - Gem version + +**Additional context** +Add any other context about the problem here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..faf014b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +# Context + + +- + +## Related tickets + +- + +# What's inside + + +- [x] A + +# Checklist: + +- [ ] I have added tests +- [ ] I have made corresponding changes to the documentation diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ef37493 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,50 @@ +name: Ruby + +on: + push: + branches: [ master ] + pull_request: + branches: [ '**' ] + +jobs: + lint: + runs-on: ubuntu-latest + env: + RUBY_VERSION: "3.3" + name: Rubocop + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Ruby w/ same version as image + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + - name: Install dependencies + run: | + gem install dip + dip bundle install + - name: Run linter + run: dip rubocop + + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ] + env: + RUBY_VERSION: ${{ matrix.ruby }} + name: Ruby ${{ matrix.ruby }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Ruby w/ same version as image + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: | + gem install dip + dip provision + - name: Run tests + run: dip appraisal rspec --format RspecJunitFormatter --out test-results/rspec_${{ matrix.ruby }}.xml --format documentation