File tree Expand file tree Collapse file tree 6 files changed +173
-40
lines changed
Expand file tree Collapse file tree 6 files changed +173
-40
lines changed Original file line number Diff line number Diff line change 1+ name : Continuous Integration
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+
11+ ci :
12+ strategy :
13+ fail-fast : false
14+ matrix :
15+ python-version : [3.8, 3.9]
16+ os : [ubuntu-latest]
17+ runs-on : ${{ matrix.os }}
18+ steps :
19+ - uses : actions/checkout@v2
20+ - uses : actions/setup-python@v2
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+ - name : Run image
24+ uses : abatilo/actions-poetry@v2.1.3
25+ - name : Install dependencies
26+ run : make install
27+ - name : Run check
28+ run : make test
Original file line number Diff line number Diff line change 1+ name : Create Release
2+ on :
3+ push :
4+ tags :
5+ - ' v*'
6+
7+ jobs :
8+ build :
9+ name : Create Release
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v2
14+ - name : Install python
15+ uses : actions/setup-python@v2
16+ with :
17+ python-version : 3.9
18+ - name : Prepare variables
19+ id : vars
20+ run : |
21+ echo ::set-output name=version::$(awk '/version/{print $NF}' pyproject.toml | sed 's/\"//g')
22+ - name : Install poetry
23+ uses : abatilo/actions-poetry@v2.1.3
24+ - name : Install dependencies
25+ run : make install
26+ - name : Run check
27+ run : make build
28+ - name : Create Release
29+ id : create_release
30+ uses : actions/create-release@v1
31+ env :
32+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33+ with :
34+ tag_name : ${{ github.ref }}
35+ release_name : Release v${{ steps.vars.outputs.version }}
36+ draft : false
37+ prerelease : false
38+ - name : Upload Release Asset
39+ id : upload-release-asset
40+ uses : actions/upload-release-asset@v1
41+ env :
42+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43+ with :
44+ upload_url : ${{ steps.create_release.outputs.upload_url }}
45+ asset_path : ./dist/report2junit-${{ steps.vars.outputs.version }}.tar.gz
46+ asset_name : report2junit-${{ steps.vars.outputs.version }}.tar.gz
47+ asset_content_type : application/tar+gzip
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ SHELL = /bin/bash -c
22VIRTUAL_ENV = $(shell poetry env info --path)
33export BASH_ENV =$(VIRTUAL_ENV ) /bin/activate
44
5- .PHONY : lint test install clean run release
5+ .PHONY : lint test install clean run build release tag
66
77lint : _black _mypy
88
@@ -11,7 +11,6 @@ test: lint
1111
1212install : $(VIRTUAL_ENV )
1313 poetry install
14- pre-commit install
1514
1615clean :
1716 [[ -d " $( VIRTUAL_ENV) " ]] && rm -rf " $( VIRTUAL_ENV) " || true
2625 report2junit --source-type cfn-guard ./sample-reports/cfn-guard.json
2726 report2junit --source-type cfn-nag ./sample-reports/cfn-nag.json
2827
29- release :
28+ build :
3029 python setup.py sdist
30+
31+ release : build
3132 twine upload dist/*
3233
3334.PHONY : _black _mypy
@@ -39,7 +40,5 @@ _black:
3940_mypy :
4041 $(info [* ] Python static type checker...)
4142 mypy --junit-xml reports/typecheck.xml report2junit
42- # --cobertura-xml-report reports
43- # --html-report reports
4443
4544$(VERBOSE ) .SILENT :
You can’t perform that action at this time.
0 commit comments