Skip to content

Commit

Permalink
added ci for pkl
Browse files Browse the repository at this point in the history
  • Loading branch information
NayanTheSpaceGuy committed Feb 19, 2025
1 parent 8475111 commit cbdd286
Show file tree
Hide file tree
Showing 2 changed files with 244 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/ci-pkl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# ==-----------------------------------------------------------== #
# SPDX-FileCopyrightText: © 2025 Nayan Patil <nayantsg@proton.me>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# ==-----------------------------------------------------------== #

# Do not modify!
# This file was generated from a template using the necronux internal pkl package.
# Any changes should be made to the template, not this file.

name: CI-Pkl
'on':
pull_request:
branches:
- develop
- stable
- release
- hotfix
paths:
- '*.pkl'
- '**/*.pkl'
- stdlib/**
- tools/**
- '*.kts'
- '**/*.kts'
- gradle/**
- gradlew
- gradlew.bat
- justfile
push:
paths:
- '*.pkl'
- '**/*.pkl'
- stdlib/**
- tools/**
- '*.kts'
- '**/*.kts'
- gradle/**
- gradlew
- gradlew.bat
- justfile
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
conclusion:
if: ${{ !cancelled() }}
needs:
- resolvecheck
- evalcheck
- test
permissions:
contents: none
runs-on: ubuntu-latest
steps:
- name: Conclusion
shell: bash
run: |-
jq -C <<< '${{ toJson(needs) }}'
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
resolvecheck:
name: Resolve Check
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Check if necronux stdlib pkl project can be resolved
shell: bash
run: just resolve-stdlibpkl
- name: Check if necronux internal pkl projects can be resolved
shell: bash
run: just resolve-internalpkl
evalcheck:
name: Eval Check
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Check if necronux stdlib pkl modules can be evaluated
shell: bash
run: just eval-stdlibpkl
- name: Check if necronux internal pkl modules can be evaluated
shell: bash
run: just eval-internalpkl
- name: Verify necronux internal pkl modules evaluation reflects the latest changes
shell: bash
run: git diff --exit-code
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Test necronux stdlib pkl modules
shell: bash
run: just test-stdlibpkl
136 changes: 136 additions & 0 deletions tools/necronux.internal.pkl.gpl/internal/.github/workflows/ci-pkl.pkl
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// ==-----------------------------------------------------------== //
// SPDX-FileCopyrightText: © 2025 Nayan Patil <nayantsg@proton.me>
//
// SPDX-License-Identifier: GPL-3.0-or-later
// ==-----------------------------------------------------------== //

@ModuleInfo { minPklVersion = "0.27.0" }

amends "../../../../commons/GitHubAction.pkl"

import "commons/commonJobs.pkl" as commonJobs
import "commons/commonSteps.pkl" as commonSteps

headercomment = """
# ==-----------------------------------------------------------== #
# SPDX-FileCopyrightText: © 2025 Nayan Patil <nayantsg@proton.me>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# ==-----------------------------------------------------------== #
"""

name = "CI-Pkl"

on {
pull_request {
branches {
"develop"
"stable"
"release"
"hotfix"
}
paths {
"*.pkl"
"**/*.pkl"
"stdlib/**"
"tools/**"
"*.kts"
"**/*.kts"
"gradle/**"
"gradlew"
"gradlew.bat"
"justfile"
}
}
push {
paths = (on.pull_request.paths) {}
}
workflow_dispatch {}
}

concurrency {
group = "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
`cancel-in-progress` = true
}

permissions {
contents = "read"
}

jobs {
["conclusion"] = (commonJobs.jobs["conclusion-push"]) {
`if` = "${{ !cancelled() }}"
needs {
"resolvecheck"
"evalcheck"
"test"
}
}

["resolvecheck"] {
name = "Resolve Check"
`runs-on` = "ubuntu-latest"
`timeout-minutes` = 30
steps {
(commonSteps.jobs["checkoutStep"].steps[0]) {}
new {
name = "Install just"
uses = "taiki-e/install-action@just"
}
new {
name = "Check if necronux stdlib pkl project can be resolved"
run = "just resolve-stdlibpkl"
shell = "bash"
}
new {
name = "Check if necronux internal pkl projects can be resolved"
run = "just resolve-internalpkl"
shell = "bash"
}
}
}
["evalcheck"] {
name = "Eval Check"
`runs-on` = "ubuntu-latest"
`timeout-minutes` = 30
steps {
(commonSteps.jobs["checkoutStep"].steps[0]) {}
new {
name = "Install just"
uses = "taiki-e/install-action@just"
}
new {
name = "Check if necronux stdlib pkl modules can be evaluated"
run = "just eval-stdlibpkl"
shell = "bash"
}
new {
name = "Check if necronux internal pkl modules can be evaluated"
run = "just eval-internalpkl"
shell = "bash"
}
new {
name = "Verify necronux internal pkl modules evaluation reflects the latest changes"
run = "git diff --exit-code"
shell = "bash"
}
}
}
["test"] {
name = "Tests"
`runs-on` = "ubuntu-latest"
`timeout-minutes` = 30
steps {
(commonSteps.jobs["checkoutStep"].steps[0]) {}
new {
name = "Install just"
uses = "taiki-e/install-action@just"
}
new {
name = "Test necronux stdlib pkl modules"
run = "just test-stdlibpkl"
shell = "bash"
}
}
}
}

0 comments on commit cbdd286

Please sign in to comment.