@@ -3,6 +3,9 @@ name: Lint and test
33on :
44 push :
55
6+ permissions :
7+ pull-requests : read
8+
69jobs :
710
811 isort :
1316 - ${{github.workspace}}:/code
1417 steps :
1518 - name : Check out code
16- uses : actions/checkout@v2
19+ uses : actions/checkout@v3
1720 - name : Check imports order
1821 run : ./scripts/check_isort
1922
2528 - ${{github.workspace}}:/code
2629 steps :
2730 - name : Check out code
28- uses : actions/checkout@v2
31+ uses : actions/checkout@v3
2932 - name : Check code format
3033 run : ./scripts/check_black
3134
3740 - ${{github.workspace}}:/code
3841 steps :
3942 - name : Check out code
40- uses : actions/checkout@v2
43+ uses : actions/checkout@v3
4144 - name : Check code errors
4245 run : ./scripts/check_flake8
4346
4952 - ${{github.workspace}}:/code
5053 steps :
5154 - name : Check out code
52- uses : actions/checkout@v2
55+ uses : actions/checkout@v3
5356 - name : Check code errors
5457 run : ./scripts/check_pylint
58+
59+ test :
60+ runs-on : ubuntu-latest
61+ container :
62+ image : sergioteula/pytools
63+ volumes :
64+ - ${{github.workspace}}:/code
65+ steps :
66+ - name : Check out code
67+ uses : actions/checkout@v3
68+ - name : Run tests
69+ run : ./scripts/run_tests
70+ - name : Save code coverage file
71+ uses : actions/upload-artifact@v3
72+ with :
73+ name : coverage
74+ path : coverage.xml
75+
76+ sonar :
77+ runs-on : ubuntu-latest
78+ needs : [test]
79+ steps :
80+ - name : Check out code
81+ uses : actions/checkout@v3
82+ with :
83+ fetch-depth : 0
84+ - name : Download a single artifact
85+ uses : actions/download-artifact@v3
86+ with :
87+ name : coverage
88+ - name : Check code errors
89+ uses : SonarSource/sonarcloud-github-action@master
90+ env :
91+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
0 commit comments