Browse Source

Rename build script & try to add code climate coverage

upstream/backport/20220103
Ruben Verweij 4 years ago
committed by Lorenzo ZOLFANELLI
parent
commit
c0cfed1c01
2 changed files with 52 additions and 4 deletions
  1. +51
    -0
      .github/workflows/code-climate.yml
  2. +1
    -4
      .github/workflows/python-package.yml

+ 51
- 0
.github/workflows/code-climate.yml View File

@ -0,0 +1,51 @@
name: CodeClimate
on:
workflow_run:
workflows: ["Build"]
types:
- completed
jobs:
code-climate:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: Set up Code Climate test reporter
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Download coverage
uses: actions/github-script@v4.0.2
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "coverage"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/coverage.zip', Buffer.from(download.data));
- name: Unzip coverage
run: |
mkdir coverage
cd coverage
unzip ../coverage.zip
- name: Code Climate test reporter
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GIT_BRANCH: ${{github.event.workflow_run.head_branch }}
GIT_COMMIT_SHA: ${{github.event.workflow_run.head_commit.id }}
run: ./cc-test-reporter after-build --exit-code $?

+ 1
- 4
.github/workflows/python-package.yml View File

@ -1,7 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
name: Build
on: on:
push: push:


Loading…
Cancel
Save