mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
* api_notable_list_2022.md: update unbundled plugins 2022.3 * element_patterns.md: new sample * 2022.3 release: update GH links * 2022.3 release: update GH links, #2 * EP list: initial, change android from GH to JB hosting temporarily + adapt links * 223 release initial values * stop recommending PreloadingActivity (internal API now) * product specific EP lists * element_patterns.md: minor * code samples: upgrade * extension_point_list.md: fix duplicate heading * sdk_code_guidelines.md: update compatibility values * spring_extension_point_list.md: update * 223.7571.182
107 lines
3.3 KiB
YAML
107 lines
3.3 KiB
YAML
name: Code Samples
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths: [ 'code_samples/**','.github/workflows/code-samples.yml' ]
|
|
pull_request:
|
|
paths: [ 'code_samples/**','.github/workflows/code-samples.yml' ]
|
|
|
|
env:
|
|
PLUGIN_VERIFIER_IDE_VERSIONS: '2022.1.4 2022.2.4 2022.3'
|
|
|
|
jobs:
|
|
|
|
gradleValidation:
|
|
name: Gradle Wrappers
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch Sources
|
|
uses: actions/checkout@v3
|
|
- name: Gradle Wrapper Validation
|
|
uses: gradle/wrapper-validation-action@v1.0.5
|
|
|
|
samples:
|
|
name: Code Samples / ${{ matrix.plugin }}
|
|
needs: gradleValidation
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
plugin:
|
|
- action_basics
|
|
- comparing_references_inspection
|
|
- conditional_operator_intention
|
|
- editor_basics
|
|
- facet_basics
|
|
- framework_basics
|
|
- inspection_basics
|
|
- kotlin_demo
|
|
- live_templates
|
|
- max_opened_projects
|
|
- module
|
|
- project_model
|
|
- project_view_pane
|
|
- project_wizard
|
|
- psi_demo
|
|
- run_configuration
|
|
- simple_language_plugin
|
|
- tool_window
|
|
- tree_structure_provider
|
|
steps:
|
|
- name: Fetch Sources
|
|
uses: actions/checkout@v3
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: zulu
|
|
java-version: 11
|
|
|
|
- name: Verify Plugin
|
|
run: (cd code_samples/${{ matrix.plugin }}; ./gradlew verifyPlugin)
|
|
- name: Test Plugin
|
|
run: (cd code_samples/${{ matrix.plugin }}; ./gradlew test)
|
|
|
|
- name: Export Properties
|
|
id: properties
|
|
shell: bash
|
|
run: |
|
|
echo "::set-output name=ideVersions::${PLUGIN_VERIFIER_IDE_VERSIONS// /-}"
|
|
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
|
|
|
|
- name: Run Plugin Verifier
|
|
run: |
|
|
echo "
|
|
tasks {
|
|
runPluginVerifier {
|
|
ideVersions.set("\"$PLUGIN_VERIFIER_IDE_VERSIONS\"".split(' ').toList())
|
|
}
|
|
}
|
|
" >> code_samples/${{ matrix.plugin }}/build.gradle.kts
|
|
cd code_samples/${{ matrix.plugin }}
|
|
./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
|
|
|
|
- name: Collect Plugin Verifier Result
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.plugin }}-pluginVerifier-result
|
|
path: ${{ github.workspace }}/code_samples/${{ matrix.plugin }}/build/reports/pluginVerifier
|
|
|
|
mirror:
|
|
name: Code Samples Mirror
|
|
if: github.ref == 'refs/heads/main' && github.repository == 'JetBrains/intellij-sdk-docs'
|
|
needs: samples
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install SSH key
|
|
uses: shimataro/ssh-key-action@v2
|
|
with:
|
|
key: ${{ secrets.SSH_KEY }}
|
|
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
|
- name: Prepare Mirror
|
|
run: |
|
|
git clone --bare git@github.com:JetBrains/intellij-sdk-docs.git .
|
|
git branch | grep -v "main" | xargs -r git branch -D
|
|
git filter-branch --prune-empty --subdirectory-filter code_samples main
|
|
git push --mirror git@github.com:JetBrains/intellij-sdk-code-samples.git
|