generated from EVerest/everest-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andreas Heinrich <[email protected]>
- Loading branch information
Showing
1 changed file
with
28 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,9 +178,6 @@ on: | |
description: 'The token to use to deploy the coverage report' | ||
required: true | ||
|
||
env: | ||
EVEREST_CI_VERSION: v1.3.1 | ||
|
||
jobs: | ||
lint: | ||
name: Lint Repository | ||
|
@@ -193,7 +190,7 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
repository: everest/everest-ci | ||
ref: ${{ needs.setup-env.outputs.sha_reusable_workflow }} | ||
ref: ${{ needs.setup-env.outputs.sha_everest_ci }} | ||
path: everest-ci | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
@@ -211,9 +208,9 @@ jobs: | |
name: Setup Environment | ||
runs-on: ${{ inputs.runner }} | ||
outputs: | ||
everest_ci_version: ${{ env.EVEREST_CI_VERSION }} | ||
workflow_path: ${{ steps.set_workflow_path.outputs.workflow_path }} | ||
sha_reusable_workflow: ${{ steps.set_sha_reusable_workflow.outputs.sha }} | ||
sha_everest_ci: ${{ steps.set_sha_everest_ci.outputs.sha }} | ||
tag_everest_ci: ${{ steps.set_tag_everest_ci.outputs.latest_tag }} | ||
steps: | ||
- name: Determine workflow_path | ||
id: set_workflow_path | ||
|
@@ -225,11 +222,32 @@ jobs: | |
f.write(f"workflow_path={workflow_path}\n") | ||
print(f"Set output workflow_path to {workflow_path}") | ||
- name: Determine SHA of the reusable workflow | ||
id: set_sha_reusable_workflow | ||
id: set_sha_everest_ci | ||
uses: canonical/[email protected] | ||
with: | ||
repository-name: everest/everest-ci | ||
file-name: continuous_integration.yml | ||
- name: Determine latest tag of everest-ci | ||
id: set_tag_everest_ci | ||
run: | | ||
TARGET_SHA="${{ steps.set_sha_everest_ci.outputs.sha }}" | ||
OWNER="everest" | ||
REPO="everest-ci" | ||
COMMITS=$(gh api repos/$OWNER/$REPO/commits?sha=$TARGET_SHA\&per_page=100 --jq '.[].sha') | ||
for COMMIT in $COMMITS; do | ||
TAG=$(gh api repos/$OWNER/$REPO/tags --jq '.[] | select(.commit.sha == "'$COMMIT'") | .name') | ||
if [ -n "$TAG" ]; then | ||
break | ||
fi | ||
done | ||
if [ -z "$TAG" ]; then | ||
echo "No tag found for commit $TARGET_SHA (only last 100 commits were checked)" | ||
exit 1 | ||
fi | ||
echo "latest_tag=$TAG" >> $GITHUB_OUTPUT | ||
build-and-push-build-kit: | ||
name: Build and Push Build Kit | ||
|
@@ -253,7 +271,7 @@ jobs: | |
${{ inputs.build_kit_scripts_directory }} | ||
${{ needs.setup-env.outputs.workflow_path }} | ||
build_args: | | ||
BASE_IMAGE_TAG=${{ needs.setup-env.outputs.everest_ci_version }} | ||
BASE_IMAGE_TAG=${{ needs.setup-env.outputs.tag_everest_ci }} | ||
build: | ||
name: Build, Unit Tests and Install | ||
|
@@ -268,7 +286,7 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
repository: everest/everest-ci | ||
ref: ${{ needs.setup-env.outputs.sha_reusable_workflow }} | ||
ref: ${{ needs.setup-env.outputs.sha_everest_ci }} | ||
path: everest-ci | ||
- name: Format branch name for cache key | ||
if: ${{ inputs.use_build_cache == 'true' }} | ||
|
@@ -467,7 +485,7 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
repository: everest/everest-ci | ||
ref: ${{ needs.setup-env.outputs.sha_reusable_workflow }} | ||
ref: ${{ needs.setup-env.outputs.sha_everest_ci }} | ||
path: everest-ci | ||
- name: Download xml coverage report | ||
uses: actions/[email protected] | ||
|