Merge pull request #1 from mipalgu/subdirs #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Swift Coverage Test | |
on: | |
pull_request: | |
branches: | |
- main | |
- development | |
push: | |
branches: [development, main] | |
jobs: | |
exec-cov: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: "5.6" | |
- name: Setup SSH Key | |
run: | | |
rm -rf ~/.ssh | |
mkdir -m 0700 ~/.ssh | |
echo "${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 | |
echo "${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub | |
chmod 0600 ~/.ssh/id_ed25519 | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_ed25519 | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
#- name: Reconfigure Private Repo URLs | |
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift | |
- name: Run tests | |
run: swift test --enable-code-coverage | |
- name: Coverage Test | |
uses: mattpolzin/swift-codecov-action@0.7.3 | |
id: cov | |
with: | |
MINIMUM_COVERAGE: 75 | |
- name: Post Positive Result | |
if: ${{ success() }} | |
run: | | |
echo "::warning file=Package.swift,line=1,col=1::The current code coverage percentage is passing with ${{ steps.cov.outputs.codecov }} (minimum allowed: ${{ steps.cov.outputs.minimum_coverage }}%)." | |
- name: Post Negative Result | |
if: ${{ failure() }} | |
run: | | |
echo "::error file=Package.swift,line=1,col=1::The current code coverage percentage is failing with ${{ steps.cov.outputs.codecov }} (minimum allowed: ${{ steps.cov.outputs.minimum_coverage }}%)." |