From e9d3f2b3882dd485950bfdda7d169531d5056c58 Mon Sep 17 00:00:00 2001 From: Daniel Lovell Date: Mon, 30 Sep 2024 02:05:26 -0700 Subject: [PATCH] Attempt to decouple docs and test jobs --- .github/workflows/docs.yaml | 65 +++++++++---------------------------- .github/workflows/test.yaml | 30 +++++++++++++---- docs/.vuepress/config.js | 33 +++++++++---------- docs/INDEX.md | 39 ++++++++++++++++++++++ 4 files changed, 94 insertions(+), 73 deletions(-) create mode 100644 docs/INDEX.md diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 587cae5..99f9e01 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -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 \ No newline at end of file + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/.vuepress/dist + destination_dir: docs + allow_empty_commit: true + keep_files: true + force_orphan: false \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0a12a8c..1c6e5d0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,12 +1,13 @@ +# .github/workflows/test.yaml name: Test on: - push: - branches: - - master - pull_request: - branches: - - master + push: + branches: + - master + pull_request: + branches: + - master jobs: testAllModes: @@ -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 }} \ No newline at end of file + 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 \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index bbeaeac..402cacb 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,18 +1,17 @@ module.exports = { - title: 'Micromissiles Unity Project', - description: 'Documentation for the Micromissiles Unity project', - 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' }, - ], - sidebar: 'auto', - }, - extendsPageData: (pageData) => { - if (pageData.relativePath === 'README.md') { - pageData.frontmatter.home = true; - } - }, -} \ No newline at end of file + 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', + }, + // Add this to ensure INDEX.md is used as the home page + patterns: ['INDEX.md', '**/*.md', '**/*.vue'], + } \ No newline at end of file diff --git a/docs/INDEX.md b/docs/INDEX.md new file mode 100644 index 0000000..a696e70 --- /dev/null +++ b/docs/INDEX.md @@ -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--windows_x86_64.zip`. +2. Unzip the zip file. The zip file should contain a single directory called `micromissiles--windows_x86_64`. +3. In the `micromissiles--windows_x86_64` directory, run `micromissiles--StandaloneWindows64.exe`. + +### Mac + +1. Download the tarball file for Darwin: `micromissiles--darwin.tar.gz`. +2. Untar the tarball. The tarball should contain a single directory called `micromissiles--darwin`. +3. In the `micromissiles--darwin` directory, run the app file. + +For more detailed information, please refer to our [documentation pages](/Keybinds_and_Controls.html).