Skip to content

doc: generate documentation from examples #2247

doc: generate documentation from examples

doc: generate documentation from examples #2247

Workflow file for this run

name: CI
on:
push:
branches:
- 'main'
- 'v8'
- 'v10.0'
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint_test_generate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup node ${{ steps.nvm.outputs.NVMRC }}
uses: actions/[email protected]
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
- name: Install
run: yarn install --network-timeout 1000000
- name: Lint
run: yarn lint
- name: Type check
run: yarn type:check
- name: Example/install
run: yarn install --ignore-scripts --network-timeout 1000000
working-directory: example
- name: Example type check
run: yarn type:check
working-directory: example
- name: Test
run: yarn unittest
- name: Generate
run: yarn generate
outputs:
NVMRC: ${{ steps.nvm.outputs.NVMRC }}
has_mapbox_token:
runs-on: ubuntu-latest
outputs:
has-mapbox-token: ${{ steps.has-mapbox-token.outputs.defined }}
steps:
- id: has-mapbox-token
env:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
if: "${{ env.MAPBOX_ACCESS_TOKEN != '' }}"
run: echo "::set-output name=defined::true"
call_android_workflow:
name: "Android/Mapbox"
needs: [lint_test_generate,has_mapbox_token]
uses: ./.github/workflows/android-actions.yml
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}
MAP_IMPL: mapbox
if: needs.has_mapbox_token.outputs.has-mapbox-token == 'true'
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
call_android_workflow_fabric:
name: "Android/Mapbox/Fabric"
needs: [lint_test_generate,has_mapbox_token]
uses: ./.github/workflows/android-actions.yml
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}
MAP_IMPL: mapbox
NEW_ARCH: true
if: needs.has_mapbox_token.outputs.has-mapbox-token == 'true'
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
call_android_workflow_11:
name: "Android/Mapbox11"
needs: [lint_test_generate,has_mapbox_token]
uses: ./.github/workflows/android-actions.yml
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}
MAP_IMPL: mapbox11
if: needs.has_mapbox_token.outputs.has-mapbox-token == 'true'
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
call_ios_workflow:
name: "iOS/Mapbox"
needs: [lint_test_generate,has_mapbox_token]
uses: ./.github/workflows/ios-actions.yml
if: needs.has_mapbox_token.outputs.has-mapbox-token == 'true'
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}
MAP_IMPL: mapbox
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
call_ios_workflow_fabric:
name: "iOS/Mapbox/Fabric"
needs: [lint_test_generate,has_mapbox_token]
uses: ./.github/workflows/ios-actions.yml
if: needs.has_mapbox_token.outputs.has-mapbox-token == 'true'
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}
MAP_IMPL: mapbox
NEW_ARCH: true
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
call_ios_workflow_11:
name: "iOS/Mapbox11"
needs: [lint_test_generate,has_mapbox_token]
uses: ./.github/workflows/ios-actions.yml
if: needs.has_mapbox_token.outputs.has-mapbox-token == 'true'
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}
MAP_IMPL: mapbox11
secrets:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MAPBOX_DOWNLOAD_TOKEN: ${{ secrets.MAPBOX_DOWNLOAD_TOKEN }}
publish:
if: startsWith(github.ref, 'refs/tags/') && (github.event_name == 'push')
needs: [lint_test_generate]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node ${{ steps.nvm.outputs.NVMRC }}
uses: actions/[email protected]
with:
node-version: ${{ needs.lint_test_generate.outputs.NVMRC }}
registry-url: https://registry.npmjs.org/
- name: Install and Publish
run: npm install --force && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}