ZFS Integration tests #129
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
name: ci-integration-test | |
run-name: ZFS Integration tests | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: ["ci-unit-test"] | |
types: | |
- completed | |
jobs: | |
build-and-test: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [20.04, 22.04] | |
runs-on: ubuntu-${{ matrix.os }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Set status pending | |
run: | | |
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
${{ github.api_url }}/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
-d '{"state":"pending","target_url":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}","description":"Integration tests is pending!","context":"continuous-integration/integration"}' | |
- name: Install zfs | |
run: | | |
sudo apt-get update | |
sudo apt install -y smartmontools | |
sudo apt install -y zfsutils-linux | |
which zfs | |
which zpool | |
which smartctl | |
which ls | |
which lsblk | |
sudo zpool status | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: | | |
dotnet nuget add source --username ${{ github.triggering_actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/bjornbouetsmith/index.json" | |
dotnet restore Source/ROOT.Zfs.sln | |
- name: Build | |
run: dotnet build Source/ROOT.Zfs.sln --no-restore --configuration Debug | |
- name: Test | |
run: dotnet test Source/**/*.Tests.csproj --configuration Debug --verbosity normal --filter "TestCategory=Integration" | |
- name: Set failed status | |
if: failure() | |
run: | | |
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
${{ github.api_url }}/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
-d '{"state":"failure","target_url":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}","description":"Integration tests failed!","context":"continuous-integration/integration"}' | |
- name: Set sucecss status | |
run: | | |
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
${{ github.api_url }}/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
-d '{"state":"success","target_url":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}","description":"Integration tests succeeded!","context":"continuous-integration/integration"}' | |
- name: Clean up | |
if: always() | |
# Cleans up potential left over from tests failing | |
run: sudo rm -rf /tmp/zfs-pool | |
continue-on-error: true |