Skip to content

[apollo-cli] Publish apollo-cli-incubating again #2749

[apollo-cli] Publish apollo-cli-incubating again

[apollo-cli] Publish apollo-cli-incubating again #2749

Workflow file for this run

name: pr
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
# Cancel any current or previous job from the same PR
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
tests-gradle:
if: "!startsWith(github.head_ref, 'release-')"
runs-on: macos-11
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew ciTestsGradle
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: tests-gradle.zip
path: diagnostics.zip
tests-no-gradle:
if: "!startsWith(github.head_ref, 'release-')"
runs-on: macos-11
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew ciTestsNoGradle --stacktrace
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: tests-no-gradle.zip
path: diagnostics.zip
tests-integration:
if: "!startsWith(github.head_ref, 'release-')"
runs-on: macos-11
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew -p tests ciBuild
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: tests-integration.zip
path: diagnostics.zip
intellij-plugin:
if: "!startsWith(github.head_ref, 'release-')"
name: Build IntelliJ Plugin
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 17
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew :intellij-plugin:properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
echo "::set-output name=version::$VERSION"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
./gradlew :intellij-plugin:listProductsReleases # prepare list of IDEs for Plugin Verifier
# Trigger code generation in test project, as the plugin's tests depend on it
- name: Test project codegen
run: ./gradlew -p tests :intellij-plugin-test-project:generateApolloSources
# Run tests
- name: Run Tests
run: ./gradlew :intellij-plugin:check
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
with:
name: tests-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/tests
# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 #v3.2.3
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('intellij-plugin/build/listProductsReleases.txt') }}
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew :intellij-plugin:runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/pluginVerifier
# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/intellij-plugin/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "::set-output name=filename::${FILENAME:0:-4}"
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./intellij-plugin/build/distributions/content/*/*