Skip to content

Commit e2d3378

Browse files
authored
Merge pull request #38 from aminya/dot [skip ci]
2 parents 1545ce4 + 97250f4 commit e2d3378

File tree

17 files changed

+140
-37
lines changed

17 files changed

+140
-37
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
os:
1818
- windows-2022
1919
- windows-2019
20+
- windows-2016
2021
- ubuntu-20.04
22+
- ubuntu-18.04
23+
- macos-11
2124
- macos-10.15
2225
node:
2326
- 14 # installed on the images
@@ -56,10 +59,12 @@ jobs:
5659
5760
# Create self-contained executable that bundles Nodejs
5861
- name: Create Executable
62+
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
5963
run: |
6064
pnpm run pack.exe
6165
6266
- name: Upload Executable
67+
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
6368
uses: actions/upload-artifact@v2
6469
with:
6570
path: |
@@ -74,6 +79,7 @@ jobs:
7479
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
7580
run: |
7681
pnpm run test
82+
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
7783

7884
Docker:
7985
runs-on: ${{ matrix.os }}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ The package can be used locally or from CI services like GitHub Actions.
4040
- choco
4141
- brew
4242
- sevenzip
43+
- graphviz
4344

4445
# Usage
4546

@@ -133,15 +134,15 @@ jobs:
133134
fail-fast: false
134135
matrix:
135136
os:
136-
- windows-2019
137+
- windows-2022
137138
- ubuntu-20.04
138-
- macos-10.15
139+
- macos-11
139140
compiler:
140141
- llvm
141142
- gcc
142143
# you can specify the version after `-` like `llvm-13.0.0`.
143144
include:
144-
- os: "windows-latest"
145+
- os: "windows-2022"
145146
compiler: "msvc"
146147
steps:
147148
- uses: actions/checkout@v2

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ inputs:
5454
doxygen:
5555
description: "The doxygen version to install."
5656
required: false
57+
graphviz:
58+
description: "The graphviz version to install."
59+
required: false
5760
cppcheck:
5861
description: "The cppcheck version to install."
5962
required: false

building/docker/debian_node.dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ADD "./dist/" "/"
66
WORKDIR "/"
77

88
# run installation
9-
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true
9+
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true
1010

11-
# reload the environment
12-
CMD source ~/.profile
11+
# reload the environment and print the versions
12+
CMD source ~/.profile && clang --version && cmake --version && ninja --version && ccache --version && cppcheck --version && vcpkg --version && doxygen --version && dot --version && gcovr --version
1313

1414
ENTRYPOINT [ "/bin/sh" ]

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build": "cross-env NODE_ENV=production parcel build --detailed-report && npm run copy.matchers",
1616
"build.docker": "pnpm build && docker build -f ./building/docker/debian_node.dockerfile -t setup_cpp .",
1717
"bump": "ncu -u -x execa",
18-
"clean": "shx rm -rf dist exe",
18+
"clean": "shx rm -rf .parcel-cache dist exe",
1919
"copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/ && shx cp ./src/msvc/msvc_matcher.json ./dist && shx cp ./src/python/python_matcher.json ./dist/ && shx cp ./src/llvm/llvm_matcher.json ./dist/ ",
2020
"dev": "cross-env NODE_ENV=development parcel watch",
2121
"format": "prettier --write .",

src/conan/conan.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { setupPipPack } from "../utils/setup/setupPipPack"
22

33
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4-
export function setupConan(version: string | undefined, _setupDir: string, _arch: string) {
4+
export async function setupConan(version: string | undefined, _setupDir: string, _arch: string) {
5+
await setupPipPack("setuptools", "")
56
return setupPipPack("conan", version)
67
}

src/doxygen/__tests__/doxygen.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { setupDoxygen } from "../doxygen"
22
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
33
import { InstallationInfo } from "../../utils/setup/setupBin"
44
import { getVersion } from "../../default_versions"
5+
import which from "which"
56

67
jest.setTimeout(300000)
78
describe("setup-doxygen", () => {
@@ -10,10 +11,12 @@ describe("setup-doxygen", () => {
1011
directory = await setupTmpDir("doxygen")
1112
})
1213

13-
it("should setup doxygen", async () => {
14+
it("should setup doxygen and dot", async () => {
1415
const installInfo = await setupDoxygen(getVersion("doxygen", undefined), directory, process.arch)
1516

1617
await testBin("doxygen", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
18+
19+
expect(which.sync("dot")).toBeDefined()
1720
})
1821

1922
afterAll(async () => {

src/doxygen/doxygen.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { setupChocoPack } from "../utils/setup/setupChocoPack"
66
import { addBinExtension } from "../utils/extension/extension"
77
import { extractTar } from "../utils/setup/extract"
88
import { warning } from "../utils/io/io"
9+
import { setupGraphviz } from "../graphviz/graphviz"
10+
import { getVersion } from "../default_versions"
911

1012
/** Get the platform data for cmake */
1113
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -30,17 +32,13 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
3032
switch (process.platform) {
3133
case "win32": {
3234
await setupChocoPack("doxygen.install", version)
33-
try {
34-
await setupChocoPack("graphviz", undefined)
35-
} catch (err) {
36-
warning(`${err}`)
37-
}
35+
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
3836
const binDir = activateWinDoxygen()
3937
return { binDir }
4038
}
4139
case "darwin": {
4240
const installationInfo = setupBrewPack("doxygen", undefined)
43-
setupBrewPack("graphviz", undefined)
41+
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
4442
return installationInfo
4543
}
4644
case "linux": {
@@ -52,7 +50,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
5250
warning(`Failed to download doxygen binary. ${err}. Falling back to apt-get.`)
5351
installationInfo = await setupAptPack("doxygen", undefined)
5452
}
55-
await setupAptPack("graphviz", undefined)
53+
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
5654
return installationInfo
5755
}
5856
default: {
@@ -62,8 +60,14 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
6260
}
6361

6462
function activateWinDoxygen() {
65-
addPath("C:/Program Files/Graphviz/bin")
66-
const binDir = "C:/Program Files/doxygen/bin"
67-
addPath(binDir)
68-
return binDir
63+
switch (process.platform) {
64+
case "win32": {
65+
const binDir = "C:/Program Files/doxygen/bin"
66+
addPath(binDir)
67+
return binDir
68+
}
69+
default: {
70+
throw new Error(`Unsupported platform`)
71+
}
72+
}
6973
}

0 commit comments

Comments
 (0)