freeCodeCamp/.github/workflows/codesee-diagram.yml

85 lines
2.8 KiB
YAML

name: CI - Create CodeSee Maps
on:
workflow_dispatch:
schedule:
- cron: '25 0/12 * * 1-5' # Build once every 12 hours, starting at 25 minutes past the hour (UTC)
pull_request_target:
paths-ignore:
- 'docs/**'
types: [opened, synchronize, reopened]
jobs:
test_map_action:
runs-on: ubuntu-20.04
if: ${{ github.actor != 'renovate[bot]' && github.actor != 'camperbot' }}
continue-on-error: true
name: Run CodeSee Map Analysis
steps:
- name: checkout
id: checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
# codesee-detect-languages has an output with id languages.
- name: Detect Languages
id: detect-languages
uses: Codesee-io/codesee-detect-languages-action@latest
- name: Configure JDK 16
uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3
if: ${{ 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 Node.js 16
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }}
with:
node-version: '16'
- name: Configure Python 3.x
uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
if: ${{ fromJSON(steps.detect-languages.outputs.languages).python }}
with:
python-version: '3.x'
architecture: 'x64'
- name: Configure Ruby '3.x'
uses: ruby/setup-ruby@v1
if: ${{ fromJSON(steps.detect-languages.outputs.languages).ruby }}
with:
ruby-version: '3.0'
# CodeSee Maps Rust support uses a static binary so there's no setup step required.
- name: Generate Map
id: generate-map
uses: Codesee-io/codesee-map-action@latest
with:
step: map
github_ref: ${{ github.ref }}
languages: ${{ steps.detect-languages.outputs.languages }}
- name: Upload Map
id: upload-map
uses: Codesee-io/codesee-map-action@latest
with:
step: mapUpload
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
github_ref: ${{ github.ref }}
- name: Insights
id: insights
uses: Codesee-io/codesee-map-action@latest
with:
step: insights
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
github_ref: ${{ github.ref }}