-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (71 loc) · 2.98 KB
/
dotnet-ci-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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