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 name: Deploy Documentation
on: on:
workflow_run: push:
workflows: ["Test"] branches:
types: - master
- completed pull_request:
branches:
- master
workflow_dispatch: # Allows manual triggering
permissions: permissions:
contents: read contents: read
@ -14,7 +18,6 @@ permissions:
jobs: jobs:
build-deploy: build-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -28,52 +31,16 @@ jobs:
run: npm install run: npm install
working-directory: './docs' 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 - name: Build documentation
run: npm run docs:build run: npm run docs:build
working-directory: './docs' working-directory: './docs'
- name: Upload artifact - name: Deploy Documentation
uses: actions/upload-pages-artifact@v2 uses: peaceiris/actions-gh-pages@v4
with: with:
path: 'docs/.vuepress/dist' github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/.vuepress/dist
deploy: destination_dir: docs
needs: build-deploy allow_empty_commit: true
runs-on: ubuntu-latest keep_files: true
environment: force_orphan: false
name: github-pages
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View File

@ -1,12 +1,13 @@
# .github/workflows/test.yaml
name: Test name: Test
on: on:
push: push:
branches: branches:
- master - master
pull_request: pull_request:
branches: branches:
- master - master
jobs: jobs:
testAllModes: testAllModes:
@ -22,12 +23,14 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
lfs: true lfs: true
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: ${{ matrix.projectPath }}/Library path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }} key: Library-${{ matrix.projectPath }}
restore-keys: | restore-keys: |
Library- Library-
- uses: game-ci/unity-test-runner@v4 - uses: game-ci/unity-test-runner@v4
id: tests id: tests
env: env:
@ -41,13 +44,26 @@ jobs:
githubToken: ${{ secrets.GITHUB_TOKEN }} githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: ${{ matrix.testMode }} Test Results checkName: ${{ matrix.testMode }} Test Results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+bamlab.*' coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+bamlab.*'
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: Test results for ${{ matrix.testMode }} name: Test results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.artifactsPath }} path: ${{ steps.tests.outputs.artifactsPath }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: Coverage results for ${{ matrix.testMode }} name: Coverage results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.coveragePath }} 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 = { module.exports = {
title: 'Micromissiles Unity Project', title: 'Micromissiles Unity Project',
description: 'Documentation for the Micromissiles Unity project', description: 'Documentation for the Micromissiles Unity project',
themeConfig: { base: '/micromissiles-unity/',
navbar: [ themeConfig: {
{ text: 'Home', link: '/' }, navbar: [
{ text: 'Keybinds and Controls', link: '/Keybinds_and_Controls.html' }, { text: 'Home', link: '/' },
{ text: 'Simulation Configuration Guide', link: '/Simulation_Config_Guide.html' }, { text: 'Keybinds and Controls', link: '/Keybinds_and_Controls.html' },
{ text: 'Simulation Logging', link: '/Simulation_Logging.html' }, { text: 'Simulation Configuration Guide', link: '/Simulation_Config_Guide.html' },
], { text: 'Simulation Logging', link: '/Simulation_Logging.html' },
sidebar: 'auto', { text: 'Coverage Reports', link: '/coverage/' }, // Link to coverage reports
}, ],
extendsPageData: (pageData) => { sidebar: 'auto',
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).