diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml new file mode 100644 index 00000000..db2db810 --- /dev/null +++ b/.github/workflows/checks.yaml @@ -0,0 +1,14 @@ +name: Checks + +on: + workflow_call: + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up to run + uses: ./.github/actions/weave + - name: Run Code Linting + run: make -k lint diff --git a/.github/workflows/docs-build.yaml b/.github/workflows/docs-build.yaml new file mode 100644 index 00000000..a43c3676 --- /dev/null +++ b/.github/workflows/docs-build.yaml @@ -0,0 +1,30 @@ +name: Build Documentation + +on: + workflow_call: + +jobs: + docs-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Build docs + run: | + mkdir -p bin + echo "PATH=$(pwd)/bin:$PATH" >> $GITHUB_ENV + curl -sSL \ + https://github.com/rust-lang/mdBook/releases/download/v0.4.24/mdbook-v0.4.24-x86_64-unknown-linux-gnu.tar.gz \ + | tar -xz --directory=bin + curl -sSL \ + https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.6/mdbook-mermaid-v0.12.6-x86_64-unknown-linux-gnu.tar.gz \ + | tar -xz --directory=bin + - name: Build docs + run: | + mdbook-mermaid install ./ + ./dev/make-all-docs.sh + mkdir workspace + cp -r ./book workspace/doc + - name: Upload documentation as an artifact + uses: actions/upload-pages-artifact@v3 + with: + path: workspace/doc diff --git a/.github/workflows/docs-publish-github-pages.yaml b/.github/workflows/docs-publish-github-pages.yaml new file mode 100644 index 00000000..37daa564 --- /dev/null +++ b/.github/workflows/docs-publish-github-pages.yaml @@ -0,0 +1,20 @@ +name: Publish Documentation + +on: + workflow_call: + +jobs: + docs-publish-github-pages: + runs-on: ubuntu-latest + environment: github-pages + permissions: + pages: write + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Ensure workspace directory exists + run: mkdir -p workspace/doc + - name: Disable Jekyll builds + run: touch workspace/doc/.nojekyll + - name: Deploy docs to GitHub Pages + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/main-workflow.yaml b/.github/workflows/main-workflow.yaml index 0574179f..c933be9e 100644 --- a/.github/workflows/main-workflow.yaml +++ b/.github/workflows/main-workflow.yaml @@ -6,102 +6,12 @@ on: - main jobs: - checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Run Code Linting - run: make -k lint - unit-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Run unit tests - run: make unit-tests - env: - TEST_RESULTS_DIR: workspace/test-results - - name: Generate Test Coverage - run: make coverage-unit - - uses: actions/upload-artifact@v4 - with: - name: unit-test-results - include-hidden-files: true - path: | - workspace/test-results - integration-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Run Integration Tests - run: make integration-tests - env: - TEST_RESULTS_DIR: workspace/test-results - - name: Generate Test Coverage - run: make coverage-integration - - uses: actions/upload-artifact@v4 - with: - name: integration-test-results - include-hidden-files: true - path: | - workspace/test-results - test-coverage-checks: - needs: [unit-tests, integration-tests] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Download All Artifacts - uses: actions/download-artifact@v4 - with: - path: workspace/test-results/ - merge-multiple: true - - name: Evaluate Minimum Test Coverage - run: make test-coverage-check - env: - TEST_RESULTS_DIR: workspace/test-results - docs-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Build docs - run: | - mkdir -p bin - echo "PATH=$(pwd)/bin:$PATH" >> $GITHUB_ENV - curl -sSL \ - https://github.com/rust-lang/mdBook/releases/download/v0.4.24/mdbook-v0.4.24-x86_64-unknown-linux-gnu.tar.gz \ - | tar -xz --directory=bin - curl -sSL \ - https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.6/mdbook-mermaid-v0.12.6-x86_64-unknown-linux-gnu.tar.gz \ - | tar -xz --directory=bin - - name: Build docs - run: | - mdbook-mermaid install ./ - ./dev/make-all-docs.sh - mkdir workspace - cp -r ./book workspace/doc - - name: Upload documentation as an artifact - uses: actions/upload-pages-artifact@v3 - with: - path: workspace/doc - docs-publish-github-pages: - needs: docs-build - runs-on: ubuntu-latest - environment: github-pages - permissions: - pages: write - id-token: write - steps: - - uses: actions/checkout@v4 - - name: Ensure workspace directory exists - run: mkdir -p workspace/doc - - name: Disable Jekyll builds - run: touch workspace/doc/.nojekyll - - name: Deploy docs to GitHub Pages - uses: actions/deploy-pages@v4 + run-checks: + uses: ./.github/workflows/checks.yaml + run-tests: + uses: ./.github/workflows/tests.yaml + run-docs-build: + uses: ./.github/workflows/docs-build.yaml + run-docs-publish-github-pages: + needs: run-docs-build + uses: ./.github/workflows/run-docs-publish-github-pages.yaml diff --git a/.github/workflows/pr-workflow.yaml b/.github/workflows/pr-workflow.yaml index 6751f9ff..05acd2df 100644 --- a/.github/workflows/pr-workflow.yaml +++ b/.github/workflows/pr-workflow.yaml @@ -3,87 +3,9 @@ name: PR Checks Workflow on: pull_request jobs: - checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Run Code Linting - run: make -k lint - unit-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Run unit tests - run: make unit-tests - env: - TEST_RESULTS_DIR: workspace/test-results - - name: Generate Test Coverage - run: make coverage-unit - - uses: actions/upload-artifact@v4 - with: - name: unit-test-results - include-hidden-files: true - path: | - workspace/test-results - integration-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Run Integration Tests - run: make integration-tests - env: - TEST_RESULTS_DIR: workspace/test-results - - name: Generate Test Coverage - run: make coverage-integration - - uses: actions/upload-artifact@v4 - with: - name: integration-test-results - include-hidden-files: true - path: | - workspace/test-results - test-coverage-checks: - needs: [unit-tests, integration-tests] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up to run - uses: ./.github/actions/weave - - name: Download All Artifacts - uses: actions/download-artifact@v4 - with: - path: workspace/test-results/ - merge-multiple: true - - name: Evaluate Minimum Test Coverage - run: make test-coverage-check - env: - TEST_RESULTS_DIR: workspace/test-results - docs-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Build docs - run: | - mkdir -p bin - echo "PATH=$(pwd)/bin:$PATH" >> $GITHUB_ENV - curl -sSL \ - https://github.com/rust-lang/mdBook/releases/download/v0.4.24/mdbook-v0.4.24-x86_64-unknown-linux-gnu.tar.gz \ - | tar -xz --directory=bin - curl -sSL \ - https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.6/mdbook-mermaid-v0.12.6-x86_64-unknown-linux-gnu.tar.gz \ - | tar -xz --directory=bin - - name: Build docs - run: | - mdbook-mermaid install ./ - ./dev/make-all-docs.sh - mkdir workspace - cp -r ./book workspace/doc - - name: Upload documentation as an artifact - uses: actions/upload-pages-artifact@v3 - with: - path: workspace/doc + run-checks: + uses: ./.github/workflows/checks.yaml + run-tests: + uses: ./.github/workflows/tests.yaml + run-docs-build: + uses: ./.github/workflows/docs-build.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..ee90c53f --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,58 @@ +name: Tests + +on: + workflow_call: + +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up to run + uses: ./.github/actions/weave + - name: Run unit tests + run: make unit-tests + env: + TEST_RESULTS_DIR: workspace/test-results + - name: Generate Test Coverage + run: make coverage-unit + - uses: actions/upload-artifact@v4 + with: + name: unit-test-results + include-hidden-files: true + path: | + workspace/test-results + integration-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up to run + uses: ./.github/actions/weave + - name: Run Integration Tests + run: make integration-tests + env: + TEST_RESULTS_DIR: workspace/test-results + - name: Generate Test Coverage + run: make coverage-integration + - uses: actions/upload-artifact@v4 + with: + name: integration-test-results + include-hidden-files: true + path: | + workspace/test-results + test-coverage-checks: + needs: [unit-tests, integration-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up to run + uses: ./.github/actions/weave + - name: Download All Artifacts + uses: actions/download-artifact@v4 + with: + path: workspace/test-results/ + merge-multiple: true + - name: Evaluate Minimum Test Coverage + run: make test-coverage-check + env: + TEST_RESULTS_DIR: workspace/test-results