Attempt to decouple docs and test jobs

master
Daniel Lovell 2024-09-30 02:05:26 -07:00
parent 765f3983f3
commit e9d3f2b388
4 changed files with 94 additions and 73 deletions

View File

@ -1,10 +1,14 @@
# .github/workflows/docs.yaml
name: Deploy Documentation
on:
workflow_run:
workflows: ["Test"]
types:
- completed
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch: # Allows manual triggering
permissions:
contents: read
@ -14,7 +18,6 @@ permissions:
jobs:
build-deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
@ -28,52 +31,16 @@ jobs:
run: npm install
working-directory: './docs'
- name: Download coverage artifacts
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifacts = artifacts.data.artifacts.filter((artifact) => {
return artifact.name.startsWith("Coverage results for")
});
for (const artifact of matchArtifacts) {
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync(`${{github.workspace}}/${artifact.name}.zip`, Buffer.from(download.data));
}
- name: Extract coverage reports
run: |
mkdir -p ./docs/.vuepress/public/coverage
for file in Coverage*.zip; do
mode=$(echo $file | sed 's/Coverage results for \(.*\)\.zip/\1/')
unzip -o "$file" -d "./docs/.vuepress/public/coverage/$mode"
done
- name: Build documentation
run: npm run docs:build
working-directory: './docs'
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
- name: Deploy Documentation
uses: peaceiris/actions-gh-pages@v4
with:
path: 'docs/.vuepress/dist'
deploy:
needs: build-deploy
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/.vuepress/dist
destination_dir: docs
allow_empty_commit: true
keep_files: true
force_orphan: false

View File

@ -1,3 +1,4 @@
# .github/workflows/test.yaml
name: Test
on:
@ -22,12 +23,14 @@ jobs:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/cache@v4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}
restore-keys: |
Library-
- uses: game-ci/unity-test-runner@v4
id: tests
env:
@ -41,13 +44,26 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: ${{ matrix.testMode }} Test Results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+bamlab.*'
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.artifactsPath }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.coveragePath }}
- name: Deploy Coverage Report
if: always()
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ steps.tests.outputs.coveragePath }}
destination_dir: coverage/${{ matrix.testMode }}
allow_empty_commit: true
keep_files: true
force_orphan: false

View File

@ -1,18 +1,17 @@
module.exports = {
title: 'Micromissiles Unity Project',
description: 'Documentation for the Micromissiles Unity project',
base: '/micromissiles-unity/',
themeConfig: {
navbar: [
{ text: 'Home', link: '/' },
{ text: 'Keybinds and Controls', link: '/Keybinds_and_Controls.html' },
{ text: 'Simulation Configuration Guide', link: '/Simulation_Config_Guide.html' },
{ text: 'Simulation Logging', link: '/Simulation_Logging.html' },
{ text: 'Coverage Reports', link: '/coverage/' }, // Link to coverage reports
],
sidebar: 'auto',
},
extendsPageData: (pageData) => {
if (pageData.relativePath === 'README.md') {
pageData.frontmatter.home = true;
}
},
// Add this to ensure INDEX.md is used as the home page
patterns: ['INDEX.md', '**/*.md', '**/*.vue'],
}

39
docs/INDEX.md Normal file
View File

@ -0,0 +1,39 @@
---
home: true
heroImage: /images/logo.png
heroText: Micromissiles Unity Project
tagline: Documentation for the Micromissiles Unity project
actionText: Get Started →
actionLink: /Keybinds_and_Controls.html
features:
- title: Swarm-on-swarm simulations
details: This project models swarm-on-swarm point defense scenarioswith multiple missile and drone models.
- title: Customizable Scenarios
details: Create and modify various engagement scenarios.
- title: Detailed Analysis
details: Comprehensive logging and data analysis tools.
---
# Micromissiles Unity Project
![Sim Salvo Animation](/images/sim_salvo_animation.gif)
## Quick Start
We generate pre-built standalone binaries for Windows and Mac users from the `release` branch. These binaries are intended for non-development users who just want to run the application and modify a few configurations along the way.
You can find the latest release [here](https://github.com/PisterLab/micromissiles-unity/releases/latest).
### Windows
1. Download the zip file for Windows: `micromissiles-<version>-windows_x86_64.zip`.
2. Unzip the zip file. The zip file should contain a single directory called `micromissiles-<version>-windows_x86_64`.
3. In the `micromissiles-<version>-windows_x86_64` directory, run `micromissiles-<version>-StandaloneWindows64.exe`.
### Mac
1. Download the tarball file for Darwin: `micromissiles-<version>-darwin.tar.gz`.
2. Untar the tarball. The tarball should contain a single directory called `micromissiles-<version>-darwin`.
3. In the `micromissiles-<version>-darwin` directory, run the app file.
For more detailed information, please refer to our [documentation pages](/Keybinds_and_Controls.html).