Skip to content

Commit

Permalink
Workflow tidying (#216)
Browse files Browse the repository at this point in the history
* Add version info output

* Simplify (and fix) job ordering
  • Loading branch information
stuartleeks committed Feb 24, 2023
1 parent 6333761 commit e6a9920
Showing 1 changed file with 34 additions and 39 deletions.
73 changes: 34 additions & 39 deletions .github/workflows/ci_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ jobs:
core.error('Failed to set image_tag');
console.log(context);
# Published action contains compiled JS, but we need to compile it here
- uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -164,6 +163,16 @@ jobs:
IS_PR
BRANCH
- name: Show version info
env:
VERSION: ${{ steps.build.outputs.version }}
VERSION_SHORT: ${{ steps.build.outputs.version_short }}
VERSION_MAJOR: ${{ steps.build.outputs.version_major }}
run: |
echo "VERSION=${VERSION}"
echo "VERSION_SHORT=${VERSION_SHORT}"
echo "VERSION_MAJOR=${VERSION_MAJOR}"
- uses: actions/upload-artifact@v3
name: Create dev AzDO VSIX artifact
with:
Expand All @@ -178,8 +187,9 @@ jobs:
path: ./output/devcontainers.ci-${{ steps.build.outputs.version }}.vsix
if-no-files-found: error

pr-checks:
name: Mark PR checks as complete
checks-succeeded:
# simple no-op job to use as step for check status
name: All succeeded
needs: # TODO - check what jobs need adding here
- build
- test-azdo
Expand All @@ -194,6 +204,18 @@ jobs:
- test-simple
- test-no-run
- test-platform-with-runcmd
- test-multiple-tags-job2
runs-on: ubuntu-latest
steps:
- name: Simple step
run: |
echo Done!
pr-checks:
name: Mark PR checks as complete
needs: # TODO - check what jobs need adding here
- checks-succeeded
runs-on: ubuntu-latest
if: ${{ inputs.prHeadSha }}
steps:
Expand All @@ -211,50 +233,17 @@ jobs:
status: "completed"
conclusion: "success"

pr-succeeded:
# simple no-op job to use as step for checks for PR checks
name: All succeeded
needs: # TODO - check what jobs need adding here
- build
- test-azdo
- test-gh-run-args
- test-gh-build-args
- test-gh-dockerfile-context
- test-gh-feature-docker-from-docker
- test-gh-docker-from-docker-non-root
- test-gh-docker-from-docker-root
- test-gh-skip-user-update
- test-compose-features
- test-simple
- test-no-run
- test-platform-with-runcmd
runs-on: ubuntu-latest
steps:
- name: Simple step
run: |
echo Done!
release:
name: Create release
runs-on: ubuntu-latest
needs:
- build
- test-azdo
- test-gh-run-args
- test-gh-build-args
- test-gh-dockerfile-context
- test-gh-feature-docker-from-docker
- test-gh-docker-from-docker-non-root
- test-gh-docker-from-docker-root
- test-gh-skip-user-update
- test-compose-features
- test-simple
- test-no-run
- test-platform-with-runcmd
- checks-succeeded
if: ${{ inputs.release == true }}
env:
VERSION: ${{ needs.build.outputs.version }}
VERSION_SHORT: ${{ needs.build.outputs.version_short }}
VERSION_MAJOR: ${{ needs.build.outputs.version_major }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -263,6 +252,12 @@ jobs:
# then the default checkout will apply
ref: ${{ inputs.prRef }}

- name: Show version info
run: |
echo "VERSION=${VERSION}"
echo "VERSION_SHORT=${VERSION_SHORT}"
echo "VERSION_MAJOR=${VERSION_MAJOR}"
- name: Download release VSIX
uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -335,7 +330,7 @@ jobs:
# Jobs to test
#
# When adding a new test:
# - add to the 'needs' section for the 'pr-succeeded', 'pr-checks' and 'releases' jobs
# - add to the 'needs' section for the 'checks-succeeded' job
# - add any new images to the image_names in clean_tags.sh
# - review the Azure DevOps pipeline and consider adding there for verification
#
Expand Down

0 comments on commit e6a9920

Please sign in to comment.