Skip to content

Commit

Permalink
Add and use cleanup-xapi-environment composite action
Browse files Browse the repository at this point in the history
Signed-off-by: Danilo Del Busso <[email protected]>
  • Loading branch information
danilo-delbusso committed Feb 16, 2024
1 parent 979dc98 commit c63f74a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/cleanup-xapi-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Cleanup XenAPI environment
description: Cleanup XenAPI environment created using the setup-xapi-environment composite action

runs:
using: "composite"
steps:
- name: Uninstall unversioned packages and remove pins
shell: bash
# This should purge them from the cache, unversioned package have
# 'master' as its version
run: |
opam list | awk -F " " '$2 == "master" { print $1 }' | xargs opam uninstall
opam pin list | cut -f1 -d "." | xargs opam unpin
11 changes: 7 additions & 4 deletions .github/workflows/generate-and-build-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ jobs:
name: SDK_Source_PowerShell
path: _build/install/default/xapi/sdk/powershell/*

- name: Cleanup XenAPI environment
uses: ./.github/workflows/cleanup-xapi-environment

build-csharp-sdk:
name: Build C# SDK
runs-on: windows-2022
needs: generate-sdk-sources
steps:
steps:
- name: Strip 'v' prefix from xapi version
shell : pwsh
shell: pwsh
run: echo "XAPI_VERSION_NUMBER=$("${{ inputs.xapi_version }}".TrimStart('v'))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Retrieve C# SDK source
Expand Down Expand Up @@ -74,7 +77,7 @@ jobs:
runs-on: windows-2019
steps:
- name: Strip 'v' prefix from xapi version
shell : pwsh
shell: pwsh
run: echo "XAPI_VERSION_NUMBER=$("${{ inputs.xapi_version }}".TrimStart('v'))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Retrieve PowerShell SDK source
Expand Down Expand Up @@ -148,7 +151,7 @@ jobs:

steps:
- name: Strip 'v' prefix from xapi version
shell : pwsh
shell: pwsh
run: echo "XAPI_VERSION_NUMBER=$("${{ inputs.xapi_version }}".TrimStart('v'))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Retrieve PowerShell SDK source
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,8 @@ jobs:
- name: Check disk space
run: df -h || true

- name: Uninstall unversioned packages and remove pins
# This should purge them from the cache, unversioned package have
# 'master' as its version
run: |
opam list | awk -F " " '$2 == "master" { print $1 }' | xargs opam uninstall
opam pin list | cut -f1 -d "." | xargs opam unpin
- name: Cleanup XenAPI environment
uses: ./.github/workflows/cleanup-xapi-environment

deprecation-test:
name: Deprecation tests
Expand All @@ -169,7 +165,7 @@ jobs:
level: error

test-sdk-builds:
name: Test SDK builds
name: Test SDK builds
uses: ./.github/workflows/generate-and-build-sdks.yml
with:
xapi_version: "0.0.0"
2 changes: 1 addition & 1 deletion .github/workflows/setup-xapi-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env
- name: Download XE_SR_ERRORCODES.xml
shell : bash
shell: bash
run: |
mkdir -p /opt/xensource/sm
wget -O /opt/xensource/sm/XE_SR_ERRORCODES.xml https://raw.githubusercontent.com/xapi-project/sm/master/drivers/XE_SR_ERRORCODES.xml
Expand Down

0 comments on commit c63f74a

Please sign in to comment.