This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
feat!: IPNS routing based on IPIP-351 or IPIP-379 #289
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gateway Conformance | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
gateway-conformance: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Start the Kubo gateway | |
- name: Download Kubo gateway | |
uses: ipfs/download-ipfs-distribution-action@v1 | |
- name: Start Kubo gateway | |
uses: ipfs/start-ipfs-daemon-action@v1 | |
# 2. Download the gateway-conformance fixtures | |
- name: Download gateway-conformance fixtures | |
uses: ipfs/gateway-conformance/.github/actions/[email protected] | |
with: | |
output: fixtures | |
# 3. Populate the Kubo gateway with the gateway-conformance fixtures | |
- name: Import fixtures | |
run: | | |
# Import car files | |
find ./fixtures -name '*.car' -exec ipfs dag import --pin-roots=false --offline {} \; | |
# 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 --offline "/ipns/$key" "$record" | |
done | |
# Import dnslink records | |
# the IPFS_NS_MAP env will be used by the daemon | |
export IPFS_NS_MAP=$(cat "./fixtures/dnslinks.json" | jq -r '.subdomains | to_entries | map("\(.key).example.com:\(.value)") | join(",")') | |
export IPFS_NS_MAP="$(cat "./fixtures/dnslinks.json" | jq -r '.domains | to_entries | map("\(.key):\(.value)") | join(",")'),${IPFS_NS_MAP}" | |
echo "IPFS_NS_MAP=${IPFS_NS_MAP}" >> $GITHUB_ENV | |
# 4. Build the bifrost-gateway | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19.x | |
- name: Checkout bifrost-gateway | |
uses: actions/checkout@v3 | |
with: | |
path: bifrost-gateway | |
- name: Build bifrost-gateway | |
run: go build | |
working-directory: bifrost-gateway | |
# 5. Start the bifrost-gateway | |
- name: Start bifrost-gateway | |
env: | |
PROXY_GATEWAY_URL: http://127.0.0.1:8080 | |
GATEWAY_CONFORMANCE_TEST: true | |
run: ./bifrost-gateway & | |
working-directory: bifrost-gateway | |
# 6. Run the gateway-conformance tests | |
- name: Run gateway-conformance tests | |
uses: ipfs/gateway-conformance/.github/actions/[email protected] | |
with: | |
gateway-url: http://127.0.0.1:8081 | |
json: output.json | |
xml: output.xml | |
html: output.html | |
markdown: output.md | |
specs: +trustless-gateway,+path-gateway,+subdomain-gateway,+dnslink-gateway,+redirects-file | |
# use below to skip specific test if needed | |
# args: -skip 'TestFooBr/GET_response_for_something' | |
# 7. Upload the results | |
- name: Upload MD summary | |
if: failure() || success() | |
run: cat output.md >> $GITHUB_STEP_SUMMARY | |
- name: Upload HTML report | |
if: failure() || success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gateway-conformance.html | |
path: output.html |