Skip to content

Commit

Permalink
GA: add verify compile step to windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
petrgazarov committed Oct 18, 2023
1 parent ee07cf3 commit 5954df2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
File renamed without changes.
26 changes: 26 additions & 0 deletions .github/scripts/verify-compile/run_powershell.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$ErrorActionPreference = "Stop"
$SALAMI_REPO_DIRECTORY = $args[0]

New-Item -ItemType Directory -Force -Path .\salami
New-Item -ItemType Directory -Force -Path .\terraform
Copy-Item "${SALAMI_REPO_DIRECTORY}\.github\scripts\verify-compile\s3_bucket.sami" -Destination .\salami\s3_bucket.sami
Copy-Item "${SALAMI_REPO_DIRECTORY}\.github\scripts\verify-compile\salami.yaml" -Destination .\salami.yaml

salami compile

if (!(Test-Path -Path .\terraform\s3_bucket.tf)) {
Write-Host "Error: terraform\s3_bucket.tf does not exist"
exit 1
}

if (!(Compare-Object (Get-Content .\terraform\s3_bucket.tf) (Get-Content "${SALAMI_REPO_DIRECTORY}\.github\scripts\verify-compile\s3_bucket.tf") -Quiet)) {
Write-Host "Error: terraform\s3_bucket.tf and ${SALAMI_REPO_DIRECTORY}\.github\scripts\verify-compile\s3_bucket.tf are not the same"

Write-Host "Contents of terraform\s3_bucket.tf:"
Get-Content .\terraform\s3_bucket.tf

Write-Host "Contents of ${SALAMI_REPO_DIRECTORY}\.github\scripts\verify-compile\s3_bucket.tf:"
Get-Content "${SALAMI_REPO_DIRECTORY}\.github\scripts\verify-compile\s3_bucket.tf"

exit 1
}
4 changes: 2 additions & 2 deletions .github/workflows/test_linux_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
version=$(salami version) || exit 1
if [[ $version != "Salami version ${{ steps.latest-tag.outputs.tag }}" ]]; then
echo "Version mismatch. Expected: Salami v${{ steps.latest-tag.outputs.tag }}, Got: $version"
echo "Version mismatch. Expected: Salami ${{ steps.latest-tag.outputs.tag }}, Got: $version"
exit 1
fi
- name: Verify compile
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: salami-repo/.github/scripts/verify-compile/run.sh salami-repo
run: salami-repo/.github/scripts/verify-compile/run_bash.sh salami-repo
4 changes: 2 additions & 2 deletions .github/workflows/test_macos_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
version=$(salami version) || exit 1
if [[ $version != "Salami version ${{ steps.latest-tag.outputs.tag }}" ]]; then
echo "Version mismatch. Expected: Salami v${{ steps.latest-tag.outputs.tag }}, Got: $version"
echo "Version mismatch. Expected: Salami ${{ steps.latest-tag.outputs.tag }}, Got: $version"
exit 1
fi
- name: Verify compile
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: salami-repo/.github/scripts/verify-compile/run.sh salami-repo
run: salami-repo/.github/scripts/verify-compile/run_bash.sh salami-repo
9 changes: 8 additions & 1 deletion .github/workflows/test_windows_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: salami-repo

- name: Install Chocolatey
run: |
Expand All @@ -28,10 +30,15 @@ jobs:
$LATEST_TAG = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/releases/latest" | Select-Object -ExpandProperty tag_name
echo "tag=$LATEST_TAG" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Verify Installation
- name: Verify version
run: |
$version = salami version
if ($version -ne "Salami version ${{ steps.latest-tag.outputs.tag }}") {
Write-Output "Version mismatch. Expected: Salami v${{ steps.latest-tag.outputs.tag }}, Got: $version"
exit 1
}
- name: Verify compile
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: .\salami-repo\.github\scripts\verify-compile\run_powershell.ps1 salami-repo

0 comments on commit 5954df2

Please sign in to comment.