-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
246 changed files
with
5,702 additions
and
2,985 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
FROM ghcr.io/nunit/docfx-action:v2.10.0 | ||
EXPOSE 8080 | ||
ARG NODE_MAJOR=20 | ||
|
||
### Installing Node LTS into the container | ||
RUN apt-get update | ||
RUN apt-get install -y ca-certificates curl gnupg | ||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
|
||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
RUN apt-get update | ||
RUN apt-get install nodejs -y | ||
|
||
### Installing Node Packages | ||
RUN npm install -g yarn | ||
RUN npm install -g npm | ||
RUN npm install -g cspell | ||
RUN npm install -g markdownlint-cli2 | ||
|
||
RUN node -v | ||
RUN npm -v | ||
RUN yarn -v | ||
|
||
### Add the aliases | ||
# We get the first workspace, because there should only be one | ||
# This is so that when someone updates their devcontainer name, it doesn't get screwed up | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias spellcheck="cspell --config /workspaces/$first_workspace/cSpell.json \"/workspaces/$first_workspace/docs/**/*.md\" --no-progress"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias lint="markdownlint-cli2-config /workspaces/$first_workspace/.github/linters/.markdownlint.yml /workspaces/$first_workspace/docs/**/*.md"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias build="docfx /workspaces/$first_workspace/docs/docfx.json"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias serve="docfx /workspaces/$first_workspace/docs/docfx.json --serve"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias snippets="dotnet test /workspaces/$first_workspace/docs/snippets/Snippets.sln"' >> ~/.bashrc | ||
FROM ghcr.io/nunit/docfx-action:v2.10.0 | ||
EXPOSE 8080 | ||
ARG NODE_MAJOR=20 | ||
|
||
### Installing Node LTS into the container | ||
RUN apt-get update | ||
RUN apt-get install -y ca-certificates curl gnupg | ||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
|
||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
RUN apt-get update | ||
RUN apt-get install nodejs unzip dos2unix -y | ||
|
||
### Installing Node Packages | ||
RUN npm install -g yarn | ||
RUN npm install -g npm | ||
RUN npm install -g cspell | ||
RUN npm install -g markdownlint-cli2 | ||
|
||
RUN node -v | ||
RUN npm -v | ||
RUN yarn -v | ||
|
||
# This script gets the api-docs from the latest NUnit release | ||
COPY get-nunit-apidocs.sh . | ||
RUN dos2unix ./get-nunit-apidocs.sh | ||
RUN chmod +x get-nunit-apidocs.sh | ||
|
||
### Add the aliases | ||
# We get the first workspace, because there should only be one | ||
# This is so that when someone updates their devcontainer name, it doesn't get screwed up | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias spellcheck="cspell --config /workspaces/$first_workspace/cSpell.json \"/workspaces/$first_workspace/docs/**/*.md\" --no-progress"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias lint="markdownlint-cli2-config /workspaces/$first_workspace/.github/linters/.markdownlint.yml /workspaces/$first_workspace/docs/**/*.md"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias build="docfx /workspaces/$first_workspace/docs/docfx.json"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias serve="docfx /workspaces/$first_workspace/docs/docfx.json --serve"' >> ~/.bashrc | ||
RUN echo 'first_workspace=\"$(cd /workspaces && ls | head -1)\"; alias snippets="dotnet test /workspaces/$first_workspace/docs/snippets/Snippets.sln"' >> ~/.bashrc | ||
|
||
# We load the latest NUnit apidocs at start in case they're needed later | ||
RUN echo 'alias apidocs="bash /get-nunit-apidocs.sh"' >> ~/.bashrc | ||
RUN echo 'apidocs' >> ~/.bashrc |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This script gets the the latest version of NUnit and extracts it. This is because docfx is capable of generating API docs, and this way the Codespace will be automatically enabled to do that. | ||
|
||
# This is hard-coded for now. | ||
NUNIT_VERSION_FOR_API_DOCS="4.0.0" | ||
|
||
first_workspace="$(cd /workspaces && ls | head -1)" | ||
|
||
wget "https://github.com/nunit/nunit/releases/download/v$NUNIT_VERSION_FOR_API_DOCS/NUnit.Framework-$NUNIT_VERSION_FOR_API_DOCS.zip" -O /apidocs.zip | ||
|
||
|
||
mkdir -p /workspaces/$first_workspace/code-output | ||
unzip -o /apidocs.zip -d /apidocs | ||
cp -r /apidocs/bin/net6.0/* /workspaces/$first_workspace/code-output | ||
rm -rf /apidocs.zip | ||
rm -rf /apidocs |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,17 @@ on: | |
branches: | ||
- master | ||
|
||
env: | ||
NUNIT_VERSION_FOR_API_DOCS: "4.0.0" | ||
|
||
jobs: | ||
linting: | ||
name: "Markdown linting" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out the code | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/setup-node@v4 | ||
name: Setup node | ||
with: | ||
node-version: "18" | ||
|
@@ -29,7 +32,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out the code | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/setup-node@v4 | ||
name: Setup node | ||
with: | ||
node-version: "18" | ||
|
@@ -43,6 +46,17 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out the code | ||
- name: Get latest NUnit Asset dir | ||
uses: dsaltares/fetch-gh-release-asset@master | ||
with: | ||
repo: 'nunit/nunit' | ||
version: 'tags/v${{ env.NUNIT_VERSION_FOR_API_DOCS }}' | ||
file: 'NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}.zip' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Unzip NUnit Asset zip file into its own directory | ||
run: unzip NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}.zip -d ./NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }} | ||
- name: Copy NUnit Asset dir | ||
run: mkdir ./code-output && cp -r ./NUnit.Framework-${{ env.NUNIT_VERSION_FOR_API_DOCS }}/bin/net6.0/* ./code-output | ||
- uses: "nunit/[email protected]" | ||
name: Build with Docfx | ||
with: | ||
|
@@ -54,6 +68,41 @@ jobs: | |
with: | ||
name: siteArtifact | ||
path: _site.zip | ||
- name: Start deployment (PR only) | ||
if: ${{ github.ref != 'refs/heads/master'}} | ||
uses: bobheadxi/deployments@v1 | ||
id: deployment | ||
with: | ||
env: preview_${{github.event.number}} | ||
step: start | ||
token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} | ||
- name: Deploy to Netlify (PR only) | ||
if: ${{ github.ref != 'refs/heads/master'}} | ||
uses: South-Paw/action-netlify-cli@v2 | ||
id: netlify | ||
with: | ||
# note that the --json flag has been passed so we can parse outputs | ||
args: deploy --json --dir './docs/_site' --message 'preview [${{ github.sha }}]' | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
- name: Update Preview link comment | ||
if: ${{ github.ref != 'refs/heads/master'}} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: previewlink | ||
message: | | ||
Preview link: ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }} | ||
- name: Finish deployment | ||
uses: bobheadxi/deployments@v1 | ||
if: ${{ github.ref != 'refs/heads/master'}} | ||
with: | ||
env: ${{ steps.deployment.outputs.env }} | ||
step: finish | ||
status: ${{ job.status }} | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | ||
env_url: ${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }} | ||
token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} | ||
snippets: | ||
name: "Build/Test Snippets" | ||
runs-on: ubuntu-latest | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
on: | ||
pull_request: | ||
types: [ closed ] | ||
jobs: | ||
prune: | ||
permissions: | ||
deployments: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: delete environment | ||
uses: bobheadxi/deployments@v1 | ||
with: | ||
step: delete-env | ||
token: ${{ secrets.SEAN_PAT_TO_MANAGE_ENVIRONMENTS }} | ||
env: preview_${{github.event.number}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
code-output/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
|
||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": [ | ||
"streetsidesoftware.code-spell-checker", | ||
"oderwat.indent-rainbow", | ||
"mdickin.markdown-shortcuts", | ||
"davidanson.vscode-markdownlint", | ||
"redhat.vscode-yaml", | ||
"vsls-contrib.codetour", | ||
"GitHub.vscode-pull-request-github", | ||
"shuworks.vscode-table-formatter", | ||
"ms-dotnettools.csharp", | ||
"github.vscode-github-actions", | ||
"ms-azuretools.vscode-docker", | ||
"stkb.rewrap" | ||
], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [ | ||
|
||
] | ||
} |
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
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
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
Oops, something went wrong.