mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Add Codecov upload step. Remove SonarCloud one, will replace by fastlane plugin.
This commit is contained in:
@@ -1,48 +0,0 @@
|
|||||||
name: Sonar
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: [ "Tests" ]
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
jobs:
|
|
||||||
sonar:
|
|
||||||
name: Sonar
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.workflow_run.conclusion == 'success'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
||||||
|
|
||||||
# Adapted from https://github.com/matrix-org/matrix-js-sdk/blob/develop/.github/workflows/sonarqube.yml
|
|
||||||
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
|
|
||||||
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
|
|
||||||
- name: Download Test Results
|
|
||||||
uses: actions/github-script@v3.1.0
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const artifacts = await github.actions.listWorkflowRunArtifacts({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
run_id: ${{ github.event.workflow_run.id }},
|
|
||||||
});
|
|
||||||
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
|
||||||
return artifact.name == "test_output"
|
|
||||||
})[0];
|
|
||||||
const download = await github.actions.downloadArtifact({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
artifact_id: matchArtifact.id,
|
|
||||||
archive_format: 'zip',
|
|
||||||
});
|
|
||||||
const fs = require('fs');
|
|
||||||
fs.writeFileSync('${{github.workspace}}/test_output.zip', Buffer.from(download.data));
|
|
||||||
|
|
||||||
- name: Extract test tesults
|
|
||||||
run: unzip -d fastlane/test_output test_output.zip && rm test_output.zip
|
|
||||||
|
|
||||||
- name: SonarCloud scan
|
|
||||||
uses: SonarSource/sonarcloud-github-action@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
@@ -34,8 +34,5 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: bundle exec fastlane tests
|
run: bundle exec fastlane tests
|
||||||
|
|
||||||
- name: Upload Test Results
|
- name: Upload coverage to Codecov
|
||||||
uses: actions/upload-artifact@v2
|
uses: codecov/codecov-action@v1.2.1
|
||||||
with:
|
|
||||||
name: test_output
|
|
||||||
path: fastlane/test_output
|
|
||||||
@@ -92,14 +92,6 @@ end
|
|||||||
|
|
||||||
lane :tests do
|
lane :tests do
|
||||||
run_tests()
|
run_tests()
|
||||||
|
|
||||||
slather(
|
|
||||||
sonarqube_xml: true,
|
|
||||||
output_directory: "./fastlane/test_output",
|
|
||||||
proj: "ElementX.xcodeproj",
|
|
||||||
scheme: "ElementX",
|
|
||||||
)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Upload IPA to Diawi"
|
desc "Upload IPA to Diawi"
|
||||||
|
|||||||
Reference in New Issue
Block a user