Skip to content

Commit

Permalink
Rewrite CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Dec 1, 2023
1 parent 5684c54 commit a8c727a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 25 deletions.
69 changes: 46 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,55 @@ on:
- '.github/img/**'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Run checks (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
chmod +x ./gradlew
sudo apt install -y xvfb
xvfb-run --auto-servernum ./gradlew --no-daemon check
./gradlew --stop
- name: Run checks (Windows)
if: matrix.os == 'windows-latest'
run: |
./gradlew --no-daemon check
./gradlew --stop
- uses: codecov/codecov-action@v3
if: success() && matrix.os == 'ubuntu-latest'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
generate-job-summary: false
- name: Run tests
run: xvfb-run --auto-servernum ./gradlew check
- name: Store coverage report
uses: actions/upload-artifact@v3
with:
name: coverage
path: build/reports/kover/report.xml

test-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
with:
generate-job-summary: false
- name: Run tests
run: ./gradlew check

upload-coverage:
needs: [ test-linux, test-windows ]
runs-on: ubuntu-latest
steps:
- name: Load coverage report
uses: actions/download-artifact@v3
with:
name: coverage
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: build/reports/kover/report.xml
files: report.xml
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## Unreleased
(empty)


## 3.0.0 -- 2023-11-17
This release brings a major overhaul of how data is generated, allowing you to create your own data types such as IP
addresses or entire JSON objects.
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/fwdekker/randomness/PopupAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.Separator
import com.intellij.openapi.ui.popup.JBPopupFactory
import com.intellij.ui.popup.list.ListPopupImpl
Expand Down Expand Up @@ -41,7 +40,8 @@ class PopupAction : AnAction(Icons.RANDOMNESS) {
event.presentation.icon = Icons.RANDOMNESS

// Running this in [actionPerformed] always sets it to `true`
isEditable = event.getData(CommonDataKeys.EDITOR)?.document?.isWritable == true
// isEditable = event.getData(CommonDataKeys.EDITOR)?.document?.isWritable == true
isEditable = true
}

/**
Expand Down

0 comments on commit a8c727a

Please sign in to comment.