Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pkl-gha
Browse files Browse the repository at this point in the history
  • Loading branch information
StefMa authored Oct 8, 2024
2 parents ed98e00 + 060d65f commit d222aad
Show file tree
Hide file tree
Showing 11 changed files with 682 additions and 226 deletions.
5 changes: 2 additions & 3 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ rules:
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'semi': 'off',
Expand All @@ -53,7 +54,6 @@ rules:
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'error',
Expand All @@ -64,6 +64,7 @@ rules:
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
Expand All @@ -76,8 +77,6 @@ rules:
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error'
}
12 changes: 12 additions & 0 deletions .github/pkl-workflows/Check-Version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if($args.count -ne 1) {
Write-Host "This command requires 1 arg with the version to check"
exit 1
}

$result = pkl.exe --version | Select-String -Pattern $args[0] -Quiet

if($result -eq "True") {
exit 0
} else {
exit 1
}
22 changes: 18 additions & 4 deletions .github/pkl-workflows/ci.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import "modules/Steps.pkl"

name = "Continuous Integration"

env {
["CHECK_VERSION"] = "0.26.0"
}

on {
pull_request {}
push {
Expand Down Expand Up @@ -54,13 +58,23 @@ jobs {
name = "Test Local Action"
uses = "./"
with {
["pkl-version"] = "0.26.3"
["pkl-version"] = "${{ env.CHECK_VERSION }}"
}
}
new {
name = "Confirm download"
run = "pkl --version"
name = "Confirm download (unix)"
`if` = "matrix.os != 'windows-latest'"
run = """
pkl --version | grep "Pkl ${{ env.CHECK_VERSION }}
"""
}
new {
name = "Confirm download (windows)"
`if` = "matrix.os == 'windows-latest'"
run = """
.github/pkl-workflows/Check-Version.ps1 "Pkl ${{ env.CHECK_VERSION }}"
"""
}
}
}
}
}
12 changes: 9 additions & 3 deletions .github/workflows/ci.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ name: Continuous Integration
push:
branches:
- main
env:
CHECK_VERSION: 0.26.0
permissions:
contents: read
jobs:
Expand Down Expand Up @@ -44,6 +46,10 @@ jobs:
- name: Test Local Action
uses: ./
with:
pkl-version: 0.26.3
- name: Confirm download
run: pkl --version
pkl-version: ${{ env.CHECK_VERSION }}
- name: Confirm download (unix)
if: matrix.os != 'windows-latest'
run: pkl --version | grep "Pkl ${{ env.CHECK_VERSION }}
- name: Confirm download (windows)
if: matrix.os == 'windows-latest'
run: .github/pkl-workflows/Check-Version.ps1 "Pkl ${{ env.CHECK_VERSION }}"
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Continuous Integration

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

env:
CHECK_VERSION: 0.26.0

jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Check Format
id: npm-format-check
run: npm run format:check

- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run ci-test

test-action:
strategy:
matrix:
# Right now macos-13 is amd64 while macos-14 is aarch64 (M1)
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Test Local Action
id: test-action
uses: ./
with:
pkl-version: ${{ env.CHECK_VERSION }}

- name: Confirm download (unix)
run: pkl --version | grep "Pkl ${{ env.CHECK_VERSION }}"
if: matrix.os != 'windows-latest'

- name: Confirm download (windows)
run: .github/workflows/Check-Version.ps1 "Pkl ${{ env.CHECK_VERSION }}"
if: matrix.os == 'windows-latest'
80 changes: 58 additions & 22 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d222aad

Please sign in to comment.