Also check dom #69
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: run-dash.js-test-vectors | |
on: | |
push: | |
branches: | |
- 'development' | |
- 'parallelize' | |
env: | |
TESTS_URL: https://testassets.dashif.org/dashjs.json | |
TESTS_FILENAME: dashjs.json | |
RESULT_DIR: /var/www/html/jccp-dashboard/production-data/dashif/ | |
jobs: | |
go-get-matrix: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate matrix | |
id: set-matrix | |
run: | | |
curl -sko ${{ env.TESTS_FILENAME }} ${{ env.TESTS_URL }} | |
echo "::set-output name=matrix::$(cat ${{ env.TESTS_FILENAME }} | jq -r -c '.items | map(.name)')" | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
run-test-vectors: | |
runs-on: ubuntu-latest | |
needs: go-get-matrix | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: | |
submenu: ${{ fromJson(needs.go-get-matrix.outputs.matrix) }} | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
extensions: curl, xdebug, xml | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
- name: Checkout out repository | |
uses: actions/checkout@v3 | |
- name: Run CLI | |
run: | | |
mkdir Conformance-Frontend/temp | |
cd Utils | |
mkdir results | |
curl -sko ${{ env.TESTS_FILENAME }} ${{ env.TESTS_URL }} | |
export vectors=$(cat ${{ env.TESTS_FILENAME }} |jq -j '.items[] | select(.name == "${{ matrix.submenu }}") | .submenu[].url as $url | $url, " "') | |
for url in $(echo $vectors) | |
do | |
outfile=results/${url//[\/:]/_} | |
php Process_cli.php -i $url > $outfile | |
if [ $(stat --format %s $outfile) -eq 31 ] | |
then | |
rm $outfile | |
fi | |
done | |
id: run_cli | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cli-results | |
path: Utils/results/ | |
get-result: | |
runs-on: ubuntu-latest | |
needs: run-test-vectors | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: cli-results | |
- name: create joined result | |
id: mangle | |
run: | | |
export JCCP_RUN_ID=$(uuidgen) | |
export JCCP_RUN_TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") | |
export JCCP_RUN_FILENAME=$(date +"%Y%m%d%H%M%S%3N").json | |
cat > "$JCCP_RUN_FILENAME" << EOF | |
{ | |
"id": "$JCCP_RUN_ID", | |
"timestamp": "$JCCP_RUN_TIMESTAMP", | |
"source": "DASH-IF Database", | |
"type": "dashif", | |
"results": [ | |
EOF | |
ls -1 http*|head -n1|xargs cat >> "$JCCP_RUN_FILENAME" | |
for i in $(ls -1 http*|tail -n+2) | |
do | |
echo , >> "$JCCP_RUN_FILENAME" | |
cat $i >> "$JCCP_RUN_FILENAME" | |
done | |
echo "]}" >> "$JCCP_RUN_FILENAME" | |
cat "$JCCP_RUN_FILENAME" | |
echo "::set-output name=result-file::$JCCP_RUN_FILENAME" | |
- name: scp results to dashboard | |
uses: appleboy/scp-action@v0.1.3 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USER }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
source: ${{ steps.mangle.outputs.result-file }} | |
target: ${{ env.RESULT_DIR }} | |
- name: add results to index | |
uses: fifsky/ssh-action@v0.0.6 | |
with: | |
host: ${{ secrets.HOST }} | |
user: ${{ secrets.USER }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
command: | | |
cd ${{ env.RESULT_DIR }} | |
echo ${{ steps.mangle.outputs.result-file }} >> index |