@cryptotaxi247 / kubo / commits / 1859e89d8

feat: update gateway-conformance to v0.1 (#9925)

Laurent Senta committed Jun 8, 2023 at 19:18 UTC 1859e89d86e36d6f8917aacc2d375738e8e4c400
1 file changed +28 -8
.github/workflows/gateway-conformance.yml
+28 -8
@@ -23,7 +23,7 @@ jobs:
23 steps:
24 # 1. Download the gateway-conformance fixtures
25 - name: Download gateway-conformance fixtures
26 - uses: ipfs/gateway-conformance/.github/actions/extract-fixtures@v0.0
26 + uses: ipfs/gateway-conformance/.github/actions/extract-fixtures@v0.1
27 with:
28 output: fixtures
29
@@ -40,8 +40,8 @@ jobs:
40 run: make build
41 working-directory: kubo-gateway
42
43 - # 3. Start the kubo-gateway
44 - - name: Start kubo-gateway
43 + # 3. Init the kubo-gateway
44 + - name: Init kubo-gateway
45 env:
46 GATEWAY_PUBLIC_GATEWAYS: |
47 {
@@ -58,16 +58,36 @@ jobs:
58 run: |
59 ./ipfs init
60 ./ipfs config --json Gateway.PublicGateways "$GATEWAY_PUBLIC_GATEWAYS"
61 - ./ipfs daemon --offline &
61 working-directory: kubo-gateway/cmd/ipfs
62
63 # 4. Populate the Kubo gateway with the gateway-conformance fixtures
64 - name: Import fixtures
66 - run: find ./fixtures -name '*.car' -exec kubo-gateway/cmd/ipfs/ipfs dag import --pin-roots=false {} \;
65 + run: |
66 + # Import car files
67 + find ./fixtures -name '*.car' -exec kubo-gateway/cmd/ipfs/ipfs dag import --pin-roots=false {} \;
68 +
69 + # Import ipns records
70 + records=$(find ./fixtures -name '*.ipns-record')
71 + for record in $records
72 + do
73 + key=$(basename -s .ipns-record "$record" | cut -d'_' -f1)
74 + kubo-gateway/cmd/ipfs/ipfs routing put --allow-offline "/ipns/$key" "$record"
75 + done
76 +
77 + # Import dnslink records
78 + # the IPFS_NS_MAP env will be used by the daemon
79 + export IPFS_NS_MAP=$(cat ./fixtures/dnslinks.json | jq -r 'to_entries | map("\(.key).example.com:\(.value)") | join(",")')
80 + echo "IPFS_NS_MAP=${IPFS_NS_MAP}" >> $GITHUB_ENV
81 +
82 + # 5. Start the kubo-gateway
83 + - name: Start kubo-gateway
84 + run: |
85 + ./ipfs daemon --offline &
86 + working-directory: kubo-gateway/cmd/ipfs
87
68 - # 5. Run the gateway-conformance tests
88 + # 6. Run the gateway-conformance tests
89 - name: Run gateway-conformance tests
70 - uses: ipfs/gateway-conformance/.github/actions/test@v0.0
90 + uses: ipfs/gateway-conformance/.github/actions/test@v0.1
91 with:
92 gateway-url: http://127.0.0.1:8080
93 json: output.json
@@ -76,7 +96,7 @@ jobs:
96 markdown: output.md
97 args: -skip 'TestGatewayCar/GET_response_for_application/vnd.ipld.car/Header_Content-Length'
98
79 - # 6. Upload the results
99 + # 7. Upload the results
100 - name: Upload MD summary
101 if: failure() || success()
102 run: cat output.md >> $GITHUB_STEP_SUMMARY