-
Notifications
You must be signed in to change notification settings - Fork 14
99 lines (95 loc) · 3.25 KB
/
test-kubo-e2e.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Test Kubo (e2e)
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
target: ['latest', 'master']
defaults:
run:
shell: bash
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.23
- uses: actions/checkout@v3
with:
path: 'gateway-conformance'
- name: Extract fixtures
uses: ./gateway-conformance/.github/actions/extract-fixtures
with:
output: fixtures
- run: go install github.com/ipfs/kubo/cmd/ipfs@${{ matrix.target }}
shell: bash
env:
GOPROXY: direct
- name: Configure Kubo Gateway
run: |
ipfs init;
source ./gateway-conformance/kubo-config.example.sh "$(pwd)/fixtures"
echo "IPFS_NS_MAP=${IPFS_NS_MAP}" >> $GITHUB_ENV
# note: the IPFS_NS_MAP set above will be passed the daemon
- uses: ipfs/start-ipfs-daemon-action@v1
with:
args: '--offline'
wait-for-addrs: false
- name: Provision Kubo Gateway
run: |
# Import car files
find ./fixtures -name '*.car' -exec ipfs dag import --pin-roots=false {} \;
# Import ipns records
records=$(find ./fixtures -name '*.ipns-record')
for record in $records
do
key=$(basename -s .ipns-record "$record" | cut -d'_' -f1)
ipfs routing put --allow-offline "/ipns/$key" "$record"
done
- name: Run the tests
uses: ./gateway-conformance/.github/actions/test
with:
gateway-url: http://127.0.0.1:8080
subdomain-url: http://example.com:8080
json: output.json
xml: output.xml
html: output.html
markdown: output.md
accept-test-failure: true
- name: Set summary
run: cat ./output.md >> $GITHUB_STEP_SUMMARY
- name: Prepare Comment
if: github.event.pull_request
env:
TARGET: ${{ matrix.target }}
run: |
echo "Results against Kubo ${{ matrix.target }}:" > comment.md
echo "(check the action's summary for the full results)" >> comment.md
# Strip everything after the results table
cat output.md | sed '/Failures\/Errors/,$d' >> comment.md
- name: Find latest comment
id: find-comment
if: github.event.pull_request
uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2.4.0
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "Results against Kubo ${{ matrix.target }}"
- name: Create comment
if: github.event.pull_request
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.2
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body-path: comment.md
- name: Upload one-page HTML report
uses: actions/upload-artifact@v3
with:
name: conformance-${{ matrix.target }}.html
path: ./output.html