Skip to content

Commit 61d58f4

Browse files
committed
bar
1 parent 6ce75ca commit 61d58f4

File tree

2 files changed

+65
-51
lines changed

2 files changed

+65
-51
lines changed

.github/workflows/go.yml

+5-51
Original file line numberDiff line numberDiff line change
@@ -49,57 +49,11 @@ jobs:
4949
with:
5050
files: coverage_unit.txt,coverage_integration.txt
5151

52-
test_create:
53-
name: Writer integration test - creation
52+
writer_integration_test:
5453
strategy:
5554
matrix:
5655
os: [ubuntu-latest, macos-latest, windows-latest]
57-
runs-on: ${{ matrix.os }}
58-
steps:
59-
- name: Set up Go
60-
uses: actions/setup-go@v1
61-
with:
62-
go-version: 1.20
63-
- name: Check out code into the Go module directory
64-
uses: actions/checkout@v1
65-
- name: Create image
66-
run: go test -v --tags=integration,integration_create --coverprofile=coverage_integration_create.txt --covermode=atomic .
67-
env:
68-
ISO_WRITER_TEST_IMAGE: ${{ runner.temp }}/writer_test.iso
69-
- name: Save created
70-
uses: actions/upload-artifact@v3
71-
with:
72-
path: ${{ runner.temp }}/writer_test.iso
73-
name: writer_test_${{ matrix.os }}.iso
74-
- name: Upload coverage to Codecov
75-
uses: codecov/codecov-action@v2
76-
with:
77-
files: coverage_integration_create.txt
78-
79-
test_verify:
80-
name: Writer integration test - verification
81-
runs-on: ubuntu-latest
82-
strategy:
83-
matrix:
84-
os: [ubuntu-latest, macos-latest, windows-latest]
85-
needs: test_create
86-
steps:
87-
- name: Set up Go
88-
uses: actions/setup-go@v1
89-
with:
90-
go-version: 1.20
91-
- name: Check out code into the Go module directory
92-
uses: actions/checkout@v1
93-
- name: Download a single artifact
94-
uses: actions/download-artifact@v3
95-
with:
96-
name: writer_test_${{ matrix.os }}.iso
97-
- name: Integration test - verify image
98-
# The test need sudo to be able to mount/umount
99-
run: sudo ISO_WRITER_TEST_IMAGE=${ISO_WRITER_TEST_IMAGE} go test -v --tags=integration,integration_verify -coverprofile=coverage_integration_verify.txt -covermode=atomic .
100-
env:
101-
ISO_WRITER_TEST_IMAGE: writer_test.iso
102-
- name: Upload coverage to Codecov
103-
uses: codecov/codecov-action@v2
104-
with:
105-
files: coverage_integration_verify.txt
56+
uses: ./.github/workflows/writer_test.yml@
57+
with:
58+
os: ${{ matrix.os }}
59+
go: 1.20

.github/workflows/writer_test.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Writer integration test
2+
on:
3+
workflow_call:
4+
inputs:
5+
os:
6+
required: true
7+
type: string
8+
go:
9+
required: false
10+
default: 1.20
11+
type: string
12+
jobs:
13+
create:
14+
name: Create image
15+
runs-on: ${{ inputs.os }}
16+
steps:
17+
- name: Set up Go
18+
uses: actions/setup-go@v1
19+
with:
20+
go-version: ${{ inputs.go }}
21+
- name: Check out code into the Go module directory
22+
uses: actions/checkout@v1
23+
- name: Create image
24+
run: go test -v --tags=integration,integration_create --coverprofile=coverage_integration_create.txt --covermode=atomic .
25+
env:
26+
ISO_WRITER_TEST_IMAGE: ${{ runner.temp }}/writer_test.iso
27+
- name: Save created
28+
uses: actions/upload-artifact@v3
29+
with:
30+
path: ${{ runner.temp }}/writer_test.iso
31+
name: writer_test_${{ inputs.os }}.iso
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@v2
34+
with:
35+
files: coverage_integration_create.txt
36+
37+
test_verify:
38+
name: Verify image
39+
runs-on: ubuntu-latest
40+
needs: test_create
41+
steps:
42+
- name: Set up Go
43+
uses: actions/setup-go@v1
44+
with:
45+
go-version: ${{ inputs.go }}
46+
- name: Check out code into the Go module directory
47+
uses: actions/checkout@v1
48+
- name: Download a single artifact
49+
uses: actions/download-artifact@v3
50+
with:
51+
name: writer_test_${{ inputs.os }}.iso
52+
- name: Integration test - verify image
53+
# The test need sudo to be able to mount/umount
54+
run: sudo ISO_WRITER_TEST_IMAGE=${ISO_WRITER_TEST_IMAGE} go test -v --tags=integration,integration_verify -coverprofile=coverage_integration_verify.txt -covermode=atomic .
55+
env:
56+
ISO_WRITER_TEST_IMAGE: writer_test.iso
57+
- name: Upload coverage to Codecov
58+
uses: codecov/codecov-action@v2
59+
with:
60+
files: coverage_integration_verify.txt

0 commit comments

Comments
 (0)