Skip to content

Commit

Permalink
Test existence of a file and condition a step
Browse files Browse the repository at this point in the history
  • Loading branch information
nhuet committed Dec 9, 2022
1 parent 89faee5 commit d0ab305
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,44 @@ concurrency:

jobs:

testing-file-existence:
runs-on: ubuntu-latest
steps:
- name: Check if coverage report exists
id: check-cov
run: |
if [ -f coverage.xml ]; then
coverage_exists=true
else
coverage_exists=false
fi
echo ${coverage_exists}
echo "coverage_exists=${coverage_exists}" >> $GITHUB_OUTPUT
- name: test output previous step
run: |
echo ${{ steps.check-cov.outputs.coverage_exists }}
echo ${{ steps.check-cov.outputs.coverage_exists == 'true' }}
- name: Export coverage report (if existing)
if: steps.check-coverage-report.ouputs.coverage_exists == 'true'
run: echo "exporting"
- name: Check if coverage report exists II
id: check-coverage-report
run: |
touch coverage.xml
if [ -f coverage.xml ]; then
coverage_exists=true
else
coverage_exists=false
fi
echo ${coverage_exists}
echo "coverage_exists=${coverage_exists}" >> $GITHUB_OUTPUT
- name: test output previous step
run: |
echo ${{ steps.check-coverage-report.outputs.coverage_exists }}
echo ${{ steps.check-coverage-report.outputs.coverage_exists == 'true' }}
- name: Export coverage report (if existing) II
if: steps.check-coverage-report.outputs.coverage_exists == 'true'
run: echo "exporting"
pwd:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions workflow_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

logger = logging.getLogger(__name__)

__version__ = "0.0.0"
__version__ = "6.0.1"


# other stuff
stuff = 1.0
stuff = 1.2

0 comments on commit d0ab305

Please sign in to comment.