Skip to content

Commit

Permalink
Merge pull request #464 from rootstrap/knapsack_ci_workflow_updates
Browse files Browse the repository at this point in the history
Knapsack ci workflow updates
  • Loading branch information
rodrieiz authored Sep 20, 2023
2 parents e21afae + 8f4490f commit c6f3dcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/update_knapsack_report.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Update Knapsack Report

# This workflow should be scheduled at certain intervals
on:
schedule:
- cron: '0 5 31 2 *'
# The above cron does not run. Replace with the wanted periodicity.
# For example, the following configuration would schedule it every 3 months
workflow_dispatch:
# This workflow should be scheduled at certain intervals
# schedule:
# - cron: '0 0 1 */3 *'
# The above cron would schedule it every 3 months. Replace with the wanted periodicity.

jobs:
build:
Expand All @@ -32,11 +31,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.1
uses: actions/setup-ruby@v1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
github_token: ${{ secrets.GITHUB_TOKEN }}
bundler-cache: true
- name: Setup Database
run: bundle exec rails db:create db:migrate
- name: Update Knapsack Report
Expand All @@ -50,10 +48,10 @@ jobs:
- name: Push changes
run: git push origin HEAD:update-knapsack-report
- name: Initialize Pull Request
uses: rootstrap/create-pull-request@v3
uses: rootstrap/create-pull-request@v5
with:
pull_request_token: ${{ secrets.GITHUB_TOKEN }}
head: update-knapsack-report
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-knapsack-report
base: main
title: 'Update Knapsack report'
maintainer_can_modify: true
Expand Down
4 changes: 4 additions & 0 deletions docs/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ It is now scheduled for February 31 so will never run.
- cron: '0 5 31 2 *'
# The above cron does not run. Replace with the wanted periodicity.
```

If the branch exists or the PR is already created the workflow will fail.
In your repository settings -> actions -> general -> Workflow permissions we need to allow read / write permissions and mark the option allow Github action to create PR, other case the workflow will fail.

## Coverage
When splitting tests in different nodes, each report covers only a part of the code files being tested.
For this reason a job in the CI is added to sums coverages from all nodes to be used by SimpleCov. This job will be executed after all nodes have finished and will send the final report to CodeClimate.
Expand Down

0 comments on commit c6f3dcc

Please sign in to comment.