Fix workflows

This commit is contained in:
akp 2020-12-11 09:21:16 +00:00
parent 22eac98cf3
commit 4ced6104ab
No known key found for this signature in database
GPG key ID: D3E7EAA31B39637E
2 changed files with 44 additions and 39 deletions

43
.github/workflows/updategraph.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Update CLOC graph
on:
workflow_dispatch:
schedule:
- cron: "0 22 * 12 *"
jobs:
graph:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Login GitHub Registry
run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GH_TKN }}
- name: Run gocloc
run: docker run --rm -v "${PWD}":/workdir docker.pkg.github.com/hhatto/gocloc/gocloc:latest --by-file --output-type=json --not-match-d="(template|.github|.vscode)" --exclude-ext=txt . > cloc.json
- run: cat cloc.json
- name: Install Matplotlib
run: pip install matplotlib
- name: Run script
run: python .github/clocgen.py cloc.json .github/clocgraph.png
- name: Git commit and push
run: |
git config user.email 'actions@github.com'
git config user.name 'github-actions'
git add .github/clocgraph.png
git commit -m 'Update CLOC graph'
git push origin HEAD:${{ github.ref }}

View file

@ -8,8 +8,6 @@ on:
jobs:
table:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
steps:
- name: Check out repository
uses: actions/checkout@v2
@ -30,40 +28,4 @@ jobs:
with:
prettier_options: --write .github/README.md
# dry: True
commit_message: "Update table"
graph:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Login GitHub Registry
run: docker login docker.pkg.github.com -u owner -p ${{ secrets.GH_TKN }}
- name: Run gocloc
run: docker run --rm -v "${PWD}":/workdir docker.pkg.github.com/hhatto/gocloc/gocloc:latest --by-file --output-type=json --not-match-d="(template|.github|.vscode)" --exclude-ext=txt . > cloc.json
- run: cat cloc.json
- name: Install Matplotlib
run: pip install matplotlib
- name: Run script
run: python .github/clocgen.py cloc.json .github/clocgraph.png
- name: Git commit and push
run: |
git config user.email 'actions@github.com'
git config user.name 'github-actions'
git add .github/clocgraph.png
git commit -m 'Update CLOC graph'
git push origin HEAD:${{ github.ref }}
commit_message: "Update table"