-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/85-powershell-azure-integration' into develop
- Loading branch information
Showing
13 changed files
with
307 additions
and
147 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# .github/workflows/build-and-test.yml | ||
|
||
name: Build and Test LabVIEW Project | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and Test the Icon Editor | ||
runs-on: [self-hosted, iconeditor] | ||
|
||
env: | ||
build_id: ${{ github.run_number }} | ||
build_revision: ${{ steps.get_revision.outputs.build_revision }} | ||
build_version: 1.0.${{ env.build_id }}.${{ env.build_revision }} | ||
RelativePath: ${{ github.workspace }} | ||
RelativePathScripts: ${{ github.workspace }}/pipeline/scripts | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Build Revision | ||
id: get_revision | ||
shell: bash | ||
run: | | ||
# Path to store the build revision counter | ||
COUNTER_FILE="${GITHUB_WORKSPACE}/.github/buildCounter.txt" | ||
echo "Counter file path: $COUNTER_FILE" | ||
|
||
# Initialize the counter file if it doesn't exist | ||
if [ ! -f "$COUNTER_FILE" ]; then | ||
echo "Counter file not found. Initializing to 1." | ||
echo "1" > "$COUNTER_FILE" | ||
fi | ||
|
||
# Read the current value | ||
build_revision=$(cat "$COUNTER_FILE") | ||
echo "Current build_revision: $build_revision" | ||
|
||
# Increment the counter | ||
new_build_revision=$((build_revision + 1)) | ||
echo "New build_revision: $new_build_revision" | ||
|
||
# Save the new value back to the file | ||
echo "$new_build_revision" > "$COUNTER_FILE" | ||
|
||
# Set the output variable | ||
echo "::set-output name=build_revision::$build_revision" | ||
|
||
# For debugging | ||
ls -la "${GITHUB_WORKSPACE}/.github" | ||
cat "$COUNTER_FILE" | ||
|
||
- name: Set agent into development mode | ||
shell: pwsh | ||
working-directory: ${{ env.RelativePathScripts }} | ||
run: | | ||
.\Set_Development_Mode.ps1 -RelativePath "${{ env.RelativePath }}" | ||
|
||
- name: Test and Build the Icon Editor | ||
shell: pwsh | ||
working-directory: ${{ env.RelativePathScripts }} | ||
env: | ||
build_id: ${{ env.build_id }} | ||
build_revision: ${{ env.build_revision }} | ||
build_version: ${{ env.build_version }} | ||
run: | | ||
.\Build.ps1 -RelativePath "${{ env.RelativePath }}" -AbsolutePathScripts "${{ env.RelativePathScripts }}" | ||
|
||
- name: Restore agent from development mode | ||
shell: pwsh | ||
working-directory: ${{ env.RelativePathScripts }} | ||
run: | | ||
.\RevertDevelopmentMode.ps1 -RelativePath "${{ env.RelativePath }}" | ||
|
||
- name: Commit and Push Build Counter | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'Increment build revision to ${{ env.build_revision }}' | ||
file_pattern: '.github/buildCounter.txt' |
Binary file not shown.
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
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
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
File renamed without changes.
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
Oops, something went wrong.