Skip to content

Commit

Permalink
Split test install workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
petrgazarov committed Oct 18, 2023
1 parent 04af4bd commit d1040dc
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 113 deletions.
113 changes: 0 additions & 113 deletions .github/workflows/test_installs.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/test_linux_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test Linux install

on:
workflow_run:
workflows: ["Release packages"]
types:
- completed
workflow_dispatch:

jobs:
test_homebrew_install:
name: Test Homebrew install

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

- name: Add Homebrew to PATH
run: echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH

- name: Tap Salami
run: brew tap petrgazarov/salami

- name: Install Salami
run: brew install salami

- name: Get latest release tag
id: latest-tag
run: |
set -euo pipefail
LATEST_TAG=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name)
echo "tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
- name: Verify Installation
run: |
set -euo pipefail
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"
exit 1
fi
42 changes: 42 additions & 0 deletions .github/workflows/test_macos_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Mac OS install

on:
workflow_run:
workflows: ["Release packages"]
types:
- completed
workflow_dispatch:

jobs:
test_homebrew_install:
name: Test Homebrew install

runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Tap Salami
run: brew tap petrgazarov/salami

- name: Install Salami
run: brew install salami

- name: Get latest release tag
id: latest-tag
run: |
set -euo pipefail
LATEST_TAG=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name)
echo "tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
- name: Verify Installation
run: |
set -euo pipefail
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"
exit 1
fi
37 changes: 37 additions & 0 deletions .github/workflows/test_windows_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test Windows install

on:
workflow_dispatch:

jobs:
test_chocolatey_install:
name: Test Chocolatey install

runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- name: Install Salami
run: choco install salami

- name: Get latest release tag
id: latest-tag
run: |
$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
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
}

0 comments on commit d1040dc

Please sign in to comment.