Skip to content

Commit 44feb3b

Browse files
authored
Merge pull request #242 from NLeSC/228-create-next-step-issues-in-workflow
Added GHA workflow to add issues which should be performed after cook…
2 parents a69f924 + 3823119 commit 44feb3b

8 files changed

Lines changed: 117 additions & 9 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: 'Next step: Sonarcloud integration'
3+
labels:
4+
- 'action required'
5+
---
6+
7+
Continuous code quality can be handled by [Sonarcloud](https://sonarcloud.io/). This repository is configured to use Sonarcloud to perform quality analysis and code coverage report on each push.
8+
9+
In order to configure Sonarcloud analysis [GitHub Action workflow](.github/workflows/sonarcloud.yml) you must follow the steps below:
10+
11+
1. go to [Sonarcloud](https://sonarcloud.io/projects/create) to create a new Sonarcloud project
12+
1. login with your GitHub account
13+
1. add Sonarcloud organization or reuse existing one
14+
1. set up a repository
15+
1. go to [new code definition administration page](https://sonarcloud.io/project/new_code?id={{ cookiecutter.github_organization }}_{{ cookiecutter.project_name }}) and select `Number of days` option
16+
1. To be able to run the analysis:
17+
1. a token must be created at [Sonarcloud account](https://sonarcloud.io/account/security/)
18+
1. the created token must be added as `SONAR_TOKEN` to [secrets on GitHub](https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_name }}/settings/secrets/actions)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 'Next step: Zenodo integration'
3+
labels:
4+
- 'action required'
5+
---
6+
7+
Zenodo integration instructions.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 'Next step: readthedocs'
3+
labels:
4+
- 'action required'
5+
---
6+
7+
Readthedocs instructions.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 'Next step: Citation data'
3+
labels:
4+
- 'action required'
5+
---
6+
7+
Citation data instructions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 'Next step: Linting'
3+
labels:
4+
- 'action required'
5+
---
6+
7+
Linting instructions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- name: "action required"
2+
color: "207909"
3+
description: "Issues that should be completed to get a fully working Python package"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
on: [push]
2+
name: Create issues for next steps
3+
jobs:
4+
next_steps:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Create labels
9+
uses: crazy-max/ghaction-github-labeler@v3
10+
with:
11+
github-token: ${{ secrets.GITHUB_TOKEN }}
12+
yaml-file: .github/next_steps/labels.yml
13+
skip-delete: true
14+
- name: Create Sonarcloud integration issue
15+
uses: JasonEtco/create-an-issue@v2
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
filename: .github/next_steps/01_sonarcloud_integration.md
20+
id: sonarcloud
21+
- name: Create Zenodo integration issue
22+
uses: JasonEtco/create-an-issue@v2
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
filename: .github/next_steps/02_zenodo_integration.md
27+
id: zenodo
28+
- name: Create readthedocs issue
29+
uses: JasonEtco/create-an-issue@v2
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
filename: .github/next_steps/03_readthedocs.md
34+
id: readthedocs
35+
- name: Create citation data issue
36+
uses: JasonEtco/create-an-issue@v2
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
filename: .github/next_steps/04_citation.md
41+
id: citation
42+
- name: Create linting issue
43+
uses: JasonEtco/create-an-issue@v2
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
filename: .github/next_steps/05_linting.md
48+
id: linting
49+
- name: List created issues
50+
run: |
51+
echo 'Created issues that must be completed to have fully working Python package:
52+
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}
53+
* Zenodo integration ${{ steps.zenodo.outputs.url }}
54+
* Readthedocs instructions ${{ steps.readthedocs.outputs.url }}
55+
* Citation data ${{ steps.citation.outputs.url }}
56+
* Linting fixes ${{ steps.linting.outputs.url }}'
57+
- name: Cleanup files needed to create next steps issues
58+
run: |
59+
git config --global user.name 'NLeSC Python template'
60+
git config --global user.email 'nlesc-python-template@users.noreply.github.com'
61+
git rm .github/workflows/next_steps.yml
62+
git rm -r .github/next_steps
63+
git commit -am "Cleanup automated next steps issue generator"
64+
git push

{{cookiecutter.project_name}}/project_setup.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,10 @@ help you decide which tool to use for packaging.
9696

9797
## Continuous code quality
9898

99-
- [Sonarcloud](https://sonarcloud.io/) is used to perform quality analysis and code coverage report on each push
100-
- Sonarcloud must be configured for the analysis to work
101-
1. go to [Sonarcloud](https://sonarcloud.io/projects/create)
102-
2. login with your GitHub account
103-
3. add organization or reuse existing one
104-
4. set up repository
105-
5. go to [new code definition administration page](https://sonarcloud.io/project/new_code?id={{ cookiecutter.github_organization }}_{{ cookiecutter.project_name }}) and select `Number of days` option
106-
- The analysis will be run by [GitHub Action workflow](.github/workflows/sonarcloud.yml)
107-
- To be able to run the analysis, a token must be created at [Sonarcloud account](https://sonarcloud.io/account/security/) and this token must be added as `SONAR_TOKEN` to [secrets on GitHub](https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_name }}/settings/secrets/actions)
99+
[Sonarcloud](https://sonarcloud.io/) is used to perform quality analysis and code coverage report
100+
101+
- `sonar-project.properties` is the SonarCloud [configuration](https://docs.sonarqube.org/latest/analysis/analysis-parameters/) file
102+
- `.github/workflows/sonarcloud.yml` is the GitHub action workflow which performs the SonarCloud analysis
108103

109104
## Package version number
110105

0 commit comments

Comments
 (0)