-
Notifications
You must be signed in to change notification settings - Fork 14
115 lines (110 loc) · 3.39 KB
/
test-prod-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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Test Production (e2e)
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
upload-fixtures:
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.4
- uses: actions/checkout@v3
with:
path: "gateway-conformance"
- name: Extract fixtures
uses: ./gateway-conformance/.github/actions/extract-fixtures
with:
output: ./
merged: true
# https://web3.storage/docs/how-tos/store/#storing-ipfs-content-archives
- name: Upload fixtures
id: upload
uses: web3-storage/add-to-web3@v2
with:
web3_token: ${{ secrets.W3STORAGE_TOKEN }}
path_to_add: 'fixtures.car'
- name: Wait for pinning
run: |
sleep 20 # 20 seconds
# see rational in https://github.com/ipfs/gateway-conformance/pull/108#discussion_r1274628865
test:
runs-on: "ubuntu-latest"
strategy:
matrix:
target: ["ipfs.runfission.com", "w3s.link"]
fail-fast: false
defaults:
run:
shell: bash
needs: upload-fixtures
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.4
- uses: actions/checkout@v3
with:
path: "gateway-conformance"
- name: Run the tests
uses: ./gateway-conformance/.github/actions/test
with:
gateway-url: https://${{ matrix.target }}
subdomain-url: https://${{ matrix.target }}
json: output.json
xml: output.xml
html: output.html
markdown: output.md
- name: Upload one-page HTML report
if: (failure() || success())
uses: actions/upload-artifact@v3
with:
name: conformance-${{ matrix.target }}.html
path: ./output.html
- name: Upload JSON output
if: (failure() || success())
uses: actions/upload-artifact@v3
with:
name: conformance-${{ matrix.target }}.json
path: ./output.json
aggregate:
runs-on: "ubuntu-latest"
needs: [test]
# the tests might have failed
if: always()
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
path: "gateway-conformance"
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Aggregate results
working-directory: ./artifacts
run: |
mkdir ./aggregates
# download-artifact downloads artifacts in a directory named after the artifact
# details: https://github.com/actions/download-artifact#download-all-artifacts
for folder in ./conformance-*.json; do
file="${folder}/output.json"
new_file="aggregates/${folder#conformance-}"
jq -ns 'inputs' "$file" | node ../gateway-conformance/aggregate.js 1 > "${new_file}"
done
node ../gateway-conformance/aggregate-into-table.js ./aggregates/*.json > ./table.md
- name: Set summary
if: (failure() || success())
run: cat ./artifacts/table.md >> $GITHUB_STEP_SUMMARY