Skip to content

test: add gateway conformance tests #2

test: add gateway conformance tests

test: add gateway conformance tests #2

name: Gateway Conformance
on:
push:
branches:
- main
pull_request:
jobs:
gateway-conformance:
runs-on: ubuntu-latest
env:

Check failure on line 12 in .github/workflows/gateway-conformance.yml

View workflow run for this annotation

GitHub Actions / Gateway Conformance

Invalid workflow file

The workflow is not valid. .github/workflows/gateway-conformance.yml (Line: 12, Col: 9): Unexpected value '' .github/workflows/gateway-conformance.yml (Line: 54, Col: 9): Unexpected value 'uses'
steps:
- name: Checkout source code
uses: actions/checkout@v4
# 1, Setup Node, install npm dependencies, and build all packages/*
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
# 2. Set up 'go' so we can install the gateway-conformance binary
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
# 3. Download the gateway-conformance fixtures using ipfs/gateway-conformance action
# This will prevent us from needing to install `docker` on the github runner
- name: Download gateway-conformance fixtures
uses: ipfs/gateway-conformance/.github/actions/[email protected]
# working-directory: ./packages/gateway-conformance
with:
output: ./packages/gateway-conformance/dist/src/fixtures/data/gateway-conformance-fixtures
# 4. Run the tests
- name: Run gateway-conformance tests
working-directory: ./packages/gateway-conformance
run: |
npm run test
# 5. Convert json output to reports similar to how it's done at https://github.com/ipfs/gateway-conformance/blob/main/.github/actions/test/action.yml
# the 'gwc-report-all.json' file is created by the 'has expected total failures and successes' test
# TODO: remove this when we're passing enough tests to use the 'ipfs/gateway-conformance/.github/actions/test' action
- name: Create the XML
working-directory: ./packages/gateway-conformance
if: failure() || success()
uses: pl-strflt/gotest-json-to-junit-xml@v1
with:
input: gwc-report-all.json
output: gwc-report-all.xml
- name: Create the HTML
working-directory: ./packages/gateway-conformance
if: failure() || success()
uses: pl-strflt/junit-xml-to-html@v1
with:
mode: no-frames
input: gwc-report-all.xml
output: gwc-report-all.html
- name: Create the Markdown
working-directory: ./packages/gateway-conformance
if: failure() || success()
uses: pl-strflt/junit-xml-to-html@v1
with:
mode: summary
input: gwc-report-all.xml
output: gwc-report-all.md
# 6. Upload the reports
- name: Upload MD summary
working-directory: ./packages/gateway-conformance
if: failure() || success()
run: cat gwc-report-all.md >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report
working-directory: ./packages/gateway-conformance
if: failure() || success()
uses: actions/upload-artifact@v3
with:
name: gateway-conformance.html
path: gwc-report-all.html
- name: Upload JSON report
working-directory: ./packages/gateway-conformance
if: failure() || success()
uses: actions/upload-artifact@v3
with:
name: gateway-conformance.json
path: gwc-report-all.json