generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
38 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
amends "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]#/GitHubAction.pkl" | ||
import "modules/Steps.pkl" | ||
|
||
// In TypeScript actions, `dist/` is a special directory. When you reference | ||
// an action with the `uses:` property, `dist/index.js` is the code that will be | ||
|
@@ -29,22 +30,7 @@ jobs { | |
name = "Check Dist" | ||
`runs-on` = "ubuntu-latest" | ||
steps { | ||
new { | ||
name = "Checkout" | ||
uses = "actions/checkout@v4" | ||
} | ||
new { | ||
name = "Setup Node.js" | ||
uses = "actions/setup-node@v4" | ||
with { | ||
["node-version-file"] = ".nvmrc" | ||
["cache"] = "npm" | ||
} | ||
} | ||
new { | ||
name = "Install Dependencies" | ||
run = "npm ci" | ||
} | ||
...Steps.checkoutAndSetupNode(null) | ||
new { | ||
name = "Build dist/ Directory" | ||
run = "npm run bundle" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
amends "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]#/GitHubAction.pkl" | ||
import "modules/Steps.pkl" | ||
|
||
name = "Continuous Integration" | ||
|
||
|
@@ -20,22 +21,7 @@ jobs { | |
name = "TypeScript Tests" | ||
`runs-on` = "ubuntu-latest" | ||
steps { | ||
new { | ||
name = "Checkout" | ||
uses = "actions/checkout@v4" | ||
} | ||
new { | ||
name = "Setup Node.js" | ||
uses = "actions/setup-node@v4" | ||
with { | ||
["node-version-file"] = ".nvmrc" | ||
["cache"] = "npm" | ||
} | ||
} | ||
new { | ||
name = "Install Dependencies" | ||
run = "npm ci" | ||
} | ||
...Steps.checkoutAndSetupNode(null) | ||
new { | ||
name = "Check Format" | ||
run = "npm run format:check" | ||
|
@@ -63,15 +49,12 @@ jobs { | |
} | ||
`runs-on` = "${{ matrix.os }}" | ||
steps { | ||
new { | ||
name = "Checkout" | ||
uses = "actions/checkout@v4" | ||
} | ||
Steps.checkout(null) | ||
new { | ||
name = "Test Local Action" | ||
uses = "./" | ||
with { | ||
["pkl-version"] = "0.26.0" | ||
["pkl-version"] = "0.26.3" | ||
} | ||
} | ||
new { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
amends "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]#/GitHubAction.pkl" | ||
import "modules/Steps.pkl" | ||
|
||
name = "Lint Codebase" | ||
|
||
|
@@ -22,25 +23,11 @@ jobs { | |
name = "Lint Codebase" | ||
`runs-on` = "ubuntu-latest" | ||
steps { | ||
new { | ||
name = "Checkout" | ||
uses = "actions/checkout@v4" | ||
with { | ||
...Steps.checkoutAndSetupNode( | ||
new Mapping<String, String|Number|Boolean> { | ||
["fetch-depth"] = 0 | ||
} | ||
} | ||
new { | ||
name = "Setup Node.js" | ||
uses = "actions/setup-node@v4" | ||
with { | ||
["node-version-file"] = ".nvmrc" | ||
["cache"] = "npm" | ||
} | ||
} | ||
new { | ||
name = "Install Dependencies" | ||
run = "npm ci" | ||
} | ||
) | ||
new { | ||
name = "Lint Codebase" | ||
uses = "super-linter/super-linter/slim@v6" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]#/GitHubAction.pkl" | ||
|
||
function checkout(): GitHubAction.Step = new { | ||
name = "checkout" | ||
function checkout(customWith: Mapping<String, String|Number|Boolean>?): GitHubAction.Step = new { | ||
name = "Checkout" | ||
uses = "actions/checkout@v4" | ||
with = customWith | ||
} | ||
|
||
function installPkl(): GitHubAction.Step = new { | ||
|
@@ -13,7 +14,27 @@ function installPkl(): GitHubAction.Step = new { | |
} | ||
} | ||
|
||
function installNode(): GitHubAction.Step = new { | ||
name = "Install node" | ||
uses = "actions/setup-node@v4" | ||
with { | ||
["node-version-file"] = ".nvmrc" | ||
["cache"] = "npm" | ||
} | ||
} | ||
|
||
function installNodeDeps(): GitHubAction.Step = new { | ||
name = "Install Dependencies" | ||
run = "npm ci" | ||
} | ||
|
||
function checkoutAndInstallPkl(): Listing<GitHubAction.Step> = new { | ||
checkout() | ||
checkout(null) | ||
installPkl() | ||
} | ||
|
||
function checkoutAndSetupNode(customCheckoutWith: Mapping<String, String|Number|Boolean>?): Listing<GitHubAction.Step> = new { | ||
checkout(customCheckoutWith) | ||
installNode() | ||
installNodeDeps() | ||
} |