From 85d57ca0ff48219ff16c1d90399d3122b62df22d Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 21 Apr 2020 22:31:52 +0200 Subject: [PATCH] GitHub Actions - Tests --- .github/workflows/tests.yml | 75 +++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e4f0e1f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,75 @@ +name: Tests +on: [push, pull_request] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Fetch Sources + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Setup Cache + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Verify Plugin + run: ./gradlew verifyPlugin --no-daemon + - name: Run Tests + run: ./gradlew test --no-daemon + build: + name: Build + needs: test + runs-on: ubuntu-latest + steps: + - name: Fetch Sources + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Setup Cache + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Export Properties + run: | + echo "::set-env name=VERSION::$(./gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')" + echo "::set-env name=NAME::$(./gradlew properties --no-daemon --console=plain -q | grep "^name:" | awk '{printf $2}')" + - name: Build Plugin + run: ./gradlew buildPlugin --no-daemon + - name: Upload artifact + uses: actions/upload-artifact@v1 + with: + name: plugin-artifact + path: ./build/distributions/${{ env.NAME }}-${{ env.VERSION }}.zip + verify: + name: Verify + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifact + uses: actions/download-artifact@v1 + with: + name: plugin-artifact + - name: Verify Plugin + id: verify + uses: ChrisCarini/intellij-platform-plugin-verifier-action@v0.0.2 + with: + plugin-location: plugin-artifact.zip + ide-versions: | + ideaIC:2020.1 +# ideaIC:LATEST-EAP-SNAPSHOT + - name: Print Logs + run: | + echo "The verifier log file [${{steps.verify.outputs.verification-output-log-filename}}] contents : " ; + cat ${{steps.verify.outputs.verification-output-log-filename}} diff --git a/README.md b/README.md index 6790212..12a4a32 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ IntelliJ Plugin Template ======================== +![Tests](https://github.com/hsz/intellij-plugin-template/workflows/Tests/badge.svg)