-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
102 lines (90 loc) · 3.59 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: "CodeSee analysis"
description: "Analyze the repo with CodeSee"
# Composite actions cannot access secrets, so we need users to provide the value
# of the CODESEE_ARCH_DIAG_API_TOKEN secret through the codesee-token variable.
# This usually look like this:
# codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
inputs:
codesee-token:
description: "The value of CODESEE_ARCH_DIAG_API_TOKEN"
required: true
codesee-url:
description: "The URL to Codesee service"
required: false
lang-setup:
description: "Which language toolchains should we install? Accepted values: 'all', 'none', or a comma separated list of languages: 'node, python, jdk, .net, rust'"
required: false
default: "all"
runs:
using: "composite"
steps:
- name: Check out the code
uses: actions/checkout@v3
id: checkout
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Configure Node.js 18
uses: actions/setup-node@v3
with:
node-version: "18"
if: ${{ inputs.lang-setup == 'all' || contains(inputs.lang-setup, 'node') }}
- name: Detect Languages
id: detect-languages
run: node ${{ github.action_path }}/detect-lang/dist/index.js
shell: bash
- name: Configure JDK 16
uses: actions/setup-java@v3
if: ${{ (inputs.lang-setup == 'all' || contains(inputs.lang-setup, 'jdk')) && fromJSON(steps.detect-languages.outputs.languages).java }}
with:
java-version: "16"
distribution: "zulu"
# CodeSee Maps Go support uses a static binary so there's no setup step required.
- name: Configure Python 3.x
uses: actions/setup-python@v4
if: ${{ (inputs.lang-setup == 'all' || contains(inputs.lang-setup, 'python')) && fromJSON(steps.detect-languages.outputs.languages).python }}
with:
python-version: "3.x"
architecture: "x64"
# We need the rust toolchain because it uses rustc and cargo to inspect the package
- name: Configure Rust 1.x stable
uses: Codesee-io/rust-toolchain@stable
if: ${{ (inputs.lang-setup == 'all' || contains(inputs.lang-setup, 'rust')) && fromJSON(steps.detect-languages.outputs.languages).rust }}
- name: Configure .NET SDK 7
uses: actions/setup-dotnet@v3
if: ${{ (inputs.lang-setup == 'all' || contains(inputs.lang-setup, '.net')) && fromJSON(steps.detect-languages.outputs.languages).dot-net }}
with:
dotnet-version: "7.x"
dotnet-quality: "ga"
- name: Generate Map
id: generate-map
run: node ${{ github.action_path }}/map/dist/index.js
shell: bash
env:
step: map
api_token: ${{ inputs.codesee-token }}
github_ref: ${{ github.ref }}
languages: ${{ steps.detect-languages.outputs.languages }}
codesee_url: ${{ inputs.codesee-url }}
NODE_OPTIONS: --max-old-space-size=6144
- name: Upload Map
id: upload-map
run: node ${{ github.action_path }}/map/dist/index.js
shell: bash
env:
step: mapUpload
api_token: ${{ inputs.codesee-token }}
github_ref: ${{ github.ref }}
codesee_url: ${{ inputs.codesee-url }}
NODE_OPTIONS: --max-old-space-size=6144
- name: Insights
id: insights
run: node ${{ github.action_path }}/map/dist/index.js
shell: bash
env:
step: insights
api_token: ${{ inputs.codesee-token }}
github_ref: ${{ github.ref }}
codesee_url: ${{ inputs.codesee-url }}
NODE_OPTIONS: --max-old-space-size=6144