Skip to content

Commit

Permalink
chore: update CI workflow to include PNPM setup and build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Dec 14, 2024
1 parent 3c9a9fd commit 636e803
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 44 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,24 @@ jobs:
with:
node-version: 20

- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9.15.0

- name: Install dependencies
run: cd ui && pnpm install

- name: Build Packages
run: cd ui && pnpm build-packages

- name: Build UI
run: cd ui && pnpm build

- name: Build with Gradle Wrapper
run: chmod +x ./gradlew && ./gradlew build
run: |
chmod +x ./gradlew
./gradlew build
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
43 changes: 0 additions & 43 deletions ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
import java.nio.file.Files
import kotlin.io.path.Path
import org.siouan.frontendgradleplugin.infrastructure.gradle.InstallFrontendTask

plugins {
id("org.siouan.frontend-jdk21") version "8.1.0"
}

repositories {
mavenCentral()
}

dependencies {
}

frontend {
nodeVersion.set("20.18.0")
assembleScript.set("pnpm run build-packages && pnpm run build")
checkScript.set("run lint")
verboseModeEnabled.set(true)
}

tasks.named<InstallFrontendTask>("installFrontend") {
val ciPlatformPresent = providers.environmentVariable("CI").isPresent
val lockFilePath = "${projectDir}\\pnpm-lock.yaml"
val retainedMetadataFileNames: Set<String>
if (ciPlatformPresent) {
retainedMetadataFileNames = setOf(lockFilePath)
} else {
// The naive configuration below allows to skip the task if the last successful execution did not change neither
// the package.json file, nor the pnpm-lock.yaml file, nor the node_modules directory. Any other scenario where
// for example the lock file is regenerated will lead to another execution before the task is "up-to-date"
// because the lock file is both an input and an output of the task.
retainedMetadataFileNames = mutableSetOf("${projectDir}\\package.json")
if (Files.exists(Path(lockFilePath))) {
retainedMetadataFileNames.add(lockFilePath)
}
outputs.file(lockFilePath).withPropertyName("lockFile")
}
inputs.files(retainedMetadataFileNames).withPropertyName("metadataFiles")
outputs.dir("${projectDir}\\node_modules").withPropertyName("nodeModulesDirectory")
}

tasks.register<Delete>("cleanDist") {
delete("${projectDir}\\dist")
}
Expand Down

0 comments on commit 636e803

Please sign in to comment.