Skip to content

Commit

Permalink
Homogenize workflow formatting (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb authored Aug 18, 2024
1 parent 2f9e364 commit 54a66ca
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 130 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI

on:
Expand Down Expand Up @@ -42,28 +43,28 @@ jobs:
needs:
- test
steps:
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v4
with:
path: exitstatus
pattern: exitstatus-*
merge-multiple: true
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v4
with:
path: exitstatus
pattern: exitstatus-*
merge-multiple: true

- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v5
with:
name: exitstatus-*
useGlob: true
failOnError: false
- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v5
with:
name: exitstatus-*
useGlob: true
failOnError: false

- name: Set Pipeline Exit Status
run: |
tree exitstatus
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Set Pipeline Exit Status
run: |
tree exitstatus
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Done
if: always()
run:
echo "All workflows finished"
- name: Done
if: always()
run:
echo "All workflows finished"
1 change: 1 addition & 0 deletions .github/workflows/get-changed-files.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
on:
workflow_call:
outputs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Pull Request or Push

on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pre-commit-action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Pre-Commit

on:
Expand Down
217 changes: 109 additions & 108 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Testing

on:
Expand All @@ -13,121 +14,121 @@ jobs:
max-parallel: 5

steps:
- uses: actions/checkout@v4
with:
# We need the full history for update tests
fetch-depth: 0
fetch-tags: true
- uses: actions/checkout@v4
with:
# We need the full history for update tests
fetch-depth: 0
fetch-tags: true

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install Nox
run: |
python -m pip install --upgrade pip
pip install nox
- name: Install Test Requirements
run: |
nox --force-color -e tests --install-only
- name: Install Test Requirements
run: |
nox --force-color -e tests --install-only
- name: Test
env:
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e tests -- -vv tests/
- name: Test
env:
SKIP_REQUIREMENTS_INSTALL: true
run: |
nox --force-color -e tests -- -vv tests/
# - name: Create CodeCov Flags
# if: always()
# id: codecov-flags
# run: |
# echo "flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")" >> "$GITHUB_OUTPUT"
# - name: Create CodeCov Flags
# if: always()
# id: codecov-flags
# run: |
# echo "flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")" >> "$GITHUB_OUTPUT"

# - name: Upload Project Code Coverage
# if: always()
# continue-on-error: true
# shell: bash
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
# REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
# REPORT_PATH: artifacts/coverage-project.xml
# run: |
# if [ ! -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi
# if [ -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi
# - name: Upload Project Code Coverage
# if: always()
# continue-on-error: true
# shell: bash
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},project
# REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project
# REPORT_PATH: artifacts/coverage-project.xml
# run: |
# if [ ! -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi
# if [ -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi

# - name: Upload Tests Code Coverage
# if: always()
# continue-on-error: true
# shell: bash
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
# REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
# REPORT_PATH: artifacts/coverage-tests.xml
# run: |
# if [ ! -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi
# if [ -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi
# - name: Upload Tests Code Coverage
# if: always()
# continue-on-error: true
# shell: bash
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# REPORT_FLAGS: ${{ steps.codecov-flags.outputs.flags }},tests
# REPORT_NAME: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests
# REPORT_PATH: artifacts/coverage-tests.xml
# run: |
# if [ ! -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if curl --max-time 30 -L https://codecov.io/bash --output codecov.sh; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi
# if [ -f codecov.sh ]; then
# n=0
# until [ "$n" -ge 5 ]
# do
# if bash codecov.sh -R $(pwd) -n "${REPORT_NAME}" -f "${REPORT_PATH}" -F "${REPORT_FLAGS}"; then
# break
# fi
# n=$((n+1))
# sleep 15
# done
# fi

- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}.log
path: artifacts/runtests-*.log
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: runtests-${{ runner.os }}.log
path: artifacts/runtests-*.log

- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v4
with:
name: exitstatus-${{ github.job }}
path: exitstatus
if-no-files-found: error
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v4
with:
name: exitstatus-${{ github.job }}
path: exitstatus
if-no-files-found: error

0 comments on commit 54a66ca

Please sign in to comment.