Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate placeholder dashboard & deploy to github pages #150

Merged
merged 10 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ runs:
mode: no-frames
input: ${{ inputs.xml }}
output: ${{ inputs.html }}
- name: Create the HTML
- name: Create the Markdown
if: inputs.markdown && (failure() || success())
uses: pl-strflt/junit-xml-to-html@v1
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
name: Generate Implementations Dashboard
name: Deploy Pages

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
schedule:
- cron: "* */1 * * *" # every one hour

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
group: "pages"
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
# Pulls the output.json from the latest successful run of the gateway-conformance.yml workflow
# and stores these as an artifacts for the build job.
pull-outputs:
runs-on: "ubuntu-latest"
strategy:
Expand Down Expand Up @@ -54,36 +64,70 @@ jobs:
with:
name: conformance-${{ steps.get-details.outputs.name }}.json
path: ./output.json
aggregate:
runs-on: "ubuntu-latest"
# https://github.com/actions/starter-workflows/blob/4a8f18e34dd13d2b6ee4d8da2ba72629eafe1609/pages/hugo.yml#L1
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.117.0
needs: [pull-outputs]
# the tests might have failed
if: always()
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: true
- name: Checkout
uses: actions/checkout@v3
with:
path: "gateway-conformance"
submodules: recursive
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Aggregate results
- name: Generate Data Aggregates
working-directory: ./artifacts
run: |
mkdir ./aggregates
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-}" # drop the ./conformance- prefix
jq -ns 'inputs' "$file" | node ../gateway-conformance/aggregate.js 1 > "${new_file}"
new_file="../aggregates/${folder#.\/conformance-}" # drop the ./conformance- prefix
jq -ns 'inputs' "$file" | node ../aggregate.js 1 > "${new_file}"
done

node ../gateway-conformance/aggregate-into-table.js ./aggregates/*.json > ./table.md
- name: Set summary
- name: Upload Data Aggregates
# will be very useful for local debugging
if: (failure() || success())
run: cat ./artifacts/table.md >> $GITHUB_STEP_SUMMARY
uses: actions/upload-artifact@v3
with:
name: dashboard-aggregates
path: ./aggregates
- name: Generate Content
run: |
node ./aggregate-into-table.js ./aggregates/*.json > ./table.md
cp ./table.md ./www/data/table.md
cat ./table.md >> $GITHUB_STEP_SUMMARY
- name: Build with Hugo
run: |
hugo \
--minify \
--baseURL ${{ steps.pages.outputs.base_url }}
working-directory: www
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./www/public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ test-docker: docker fixtures.car gateway-conformance
docker run --rm -v "${PWD}:/workspace" -w "/workspace" ghcr.io/pl-strflt/saxon:v1 -s:./reports/output.xml -xsl:/etc/junit-noframes-saxon.xsl -o:./reports/output.html
open ./reports/output.html

./reports/output.md: ./reports/output.xml
docker run --rm -v "${PWD}:/workspace" -w "/workspace" ghcr.io/pl-strflt/saxon:v1 -s:./reports/output.xml -xsl:/etc/junit-summary.xsl -o:./reports/output.md

docker:
docker build --build-arg VERSION="$(CLI_VERSION)" -t gateway-conformance .

Expand Down
11 changes: 8 additions & 3 deletions aggregate-into-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ inputs.forEach((input, index) => {
let name = files[index].replace(/\.json$/, '').replace(/^.*\//, '');

// extract TestMetadata & version
const metadata = input[TestMetadata]["meta"];
const version = metadata['version'];
const jobURL = metadata['job_url'];
let version = 'unknown';
let jobURL = null;

if (input[TestMetadata]) {
const metadata = input[TestMetadata]["meta"];
version = metadata['version'];
jobURL = metadata['job_url'];
}

let versionCell = version
if (jobURL) {
Expand Down
2 changes: 2 additions & 0 deletions www/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.hugo_build.lock
/public
6 changes: 6 additions & 0 deletions www/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

17 changes: 17 additions & 0 deletions www/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
baseURL: http://example.org/
languageCode: en-us
title: Gateway Conformance Dashboard

theme:
- conformance
- sk1

markup:
goldmark:
renderer:
unsafe: true

taxonomies:
ipip: ipips
test: tests
result: results
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
26 changes: 26 additions & 0 deletions www/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Home
published: true
date: 2023-08-14
---

# Gateway Conformance Dashboard

<img src="{{< url "logo.png" >}}" style="max-width: 12rem;" />

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt sagittis arcu, in tempus nisi molestie at. Suspendisse imperdiet viverra fringilla. Sed eleifend elementum sem. Phasellus orci lectus, laoreet in sapien vulputate, bibendum cursus neque. Quisque luctus dictum ligula, sit amet sagittis lacus consectetur eget. Phasellus non diam sem. Duis pellentesque tellus quis dolor sodales, vitae faucibus nulla ornare. Proin eget odio eu orci tristique volutpat. Nunc non vehicula neque. Maecenas volutpat mollis sem eget vestibulum.

[Current Dashboard]({{< ref "/current" >}})

## List of Gateway Implementation Tested

{{< gateways-links >}}

## List of Specs Tested

{{< specs-links >}}

## Related Projects:

- ipip specs
- etc
7 changes: 7 additions & 0 deletions www/content/current.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
date: 2023-08-14
---

# Current

{{< current-table >}}
4 changes: 4 additions & 0 deletions www/content/specs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

This is the entry-point for the conformance gateway dashboard when coming from the specs.
1 change: 1 addition & 0 deletions www/data/table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
placeholder
Empty file added www/static/favicon.ico
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
Binary file added www/static/logo.png
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions www/themes/conformance/layouts/shortcodes/current-table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
{{ $file := "data/table.md" }}
{{ $file | readFile | markdownify }}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(Gateway Links Work In Progress)
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions www/themes/conformance/layouts/shortcodes/include.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ $file := .Get 0 }}
{{ $file | readFile | markdownify }}
1 change: 1 addition & 0 deletions www/themes/conformance/layouts/shortcodes/specs-links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(Specs Links Work In Progress)
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions www/themes/conformance/layouts/shortcodes/url.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{/* make pathing for most URLs stable over any type of domain, base url, etc. */}}
{{ .Get 0 | absURL }}
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions www/themes/conformance/theme.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description = ""
features = []
homepage = ""
license = ""
licenselink = ""
min_version = ""
name = "conformance"
tags = []

[author]
homepage = ""
name = ""
20 changes: 20 additions & 0 deletions www/themes/sk1/LICENSE
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2020 John Siu

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 changes: 21 additions & 0 deletions www/themes/sk1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Hugo Theme - SK1 (Skeleton 1)

[![Paypal donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/donate/?business=HZF49NM9D35SJ&no_recurring=0&currency_code=CAD)

Fully functional basic Hugo theme with no css, no javascript.

Intended for learning hugo theme structure and functions.

Heavily trimmed-down for the conformance-testing needs.

## License

The MIT License (MIT)

Copyright (c) 2020 John Siu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions www/themes/sk1/layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{define "main"}}
Page Not Found.
{{end}}
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions www/themes/sk1/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}

<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>

</html>
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions www/themes/sk1/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{define "main"}}

<!--Content-->
{{.Content}}

<!--$paginator-->
{{$p := .Pages}}
{{if .IsHome}}
{{$p = where site.RegularPages "Type" "in" site.Params.mainSections}}
{{else if eq .Kind "taxonomy"}}
{{$p = $p.ByTitle}}
{{end}}
{{$paginator := .Paginate $p}}

<!--list-->
<ul>
{{range $paginator.Pages}}
<li>{{.Date.Format "2006-01-02"}} | <a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}
</ul>

<!--pagination-->
{{template "_internal/pagination.html" .}}

{{end}}
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
37 changes: 37 additions & 0 deletions www/themes/sk1/layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{define "main"}}

<!--Title-->
<h2>{{.Title}}</h2>

<!--Date-->
{{.Date.Format "2006-01-02"}}

<!--TOC-->
{{.TableOfContents}}

<!--Content-->
{{.Content}}

<!--Tag-->
<ul>
{{range (.GetTerms "tags")}}
<li><a href="{{.RelPermalink}}">{{.LinkTitle}}</a></li>
{{end}}
</ul>

<!--Prev/Next-->
{{with .PrevInSection}}Prev <a href="{{.RelPermalink}}">{{.Title}}</a>{{end}}
{{with .NextInSection}}Next <a href="{{.RelPermalink}}">{{.Title}}</a>{{end}}

<!--Related-->
{{$related := .Site.RegularPages.Related . | first 5}}
{{with $related}}
<h3>See Also</h3>
<ul>
{{range .}}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}
</ul>
{{end}}

{{end}}
1 change: 1 addition & 0 deletions www/themes/sk1/layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{with .Site.Copyright}}{{.}} / {{end}}
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
4 changes: 4 additions & 0 deletions www/themes/sk1/layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!--Site Title-->
<a href="{{ "" | relLangURL}}">{{site.Title}}</a>
<!--Sub-title-->
{{with site.Params.subtitle}} / {{.}}{{end}}
laurentsenta marked this conversation as resolved.
Show resolved Hide resolved
Loading