Skip to content

Commit 6daaa9e

Browse files
committed
Migrate to GitHub Actions
Also: * Bump Go to 1.25 * Bump Pkl to 0.30 * Add hawkeye license formatting * Add checks for hawkeye formatting and pkl formatting
1 parent 9ed2795 commit 6daaa9e

File tree

31 files changed

+478
-152
lines changed

31 files changed

+478
-152
lines changed

.circleci/config.pkl

Lines changed: 0 additions & 52 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/PklProject

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//===----------------------------------------------------------------------===//
2+
// Copyright © 2025 Apple Inc. and the Pkl project authors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// https://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//===----------------------------------------------------------------------===//
16+
17+
amends "pkl:Project"
18+
19+
dependencies {
20+
["pkl.impl.ghactions"] {
21+
uri = "package://pkg.pkl-lang.org/pkl-project-commons/[email protected]"
22+
}
23+
["gha"] {
24+
uri = "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]"
25+
}
26+
}

.github/PklProject.deps.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"schemaVersion": 1,
3+
"resolvedDependencies": {
4+
"package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/com.github.action@0": {
5+
"type": "remote",
6+
"uri": "projectpackage://pkg.pkl-lang.org/github.com/stefma/pkl-gha/[email protected]",
7+
"checksums": {
8+
"sha256": "84365239996740252a91abab084d443aa3a3438f375b667ac16cb765461c1555"
9+
}
10+
},
11+
"package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@0": {
12+
"type": "remote",
13+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/[email protected]",
14+
"checksums": {
15+
"sha256": "f8efc4b174855a2fafdab8ed792de4b0cb89b0516d688c8540eea13af20e0f80"
16+
}
17+
}
18+
}
19+
}

.github/index.pkl

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//===----------------------------------------------------------------------===//
2+
// Copyright © 2025 Apple Inc. and the Pkl project authors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// https://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//===----------------------------------------------------------------------===//
16+
17+
amends "@pkl.impl.ghactions/PklCI.pkl"
18+
19+
import "@gha/actions/Common.pkl"
20+
import "@gha/actions/Setup.pkl"
21+
import "@gha/Workflow.pkl"
22+
import "@pkl.impl.ghactions/jobs/HawkeyeCheck.pkl"
23+
import "@pkl.impl.ghactions/steps/SetupPkl.pkl"
24+
25+
local test: Workflow = new {
26+
jobs {
27+
["test"] {
28+
`runs-on` = "ubuntu-latest"
29+
steps {
30+
new Common.Checkout {}
31+
new Setup.Go {
32+
with {
33+
`go-version` = "1.25"
34+
}
35+
}
36+
new SetupPkl { version = "0.30.0" }.step
37+
new {
38+
name = "go generate"
39+
run =
40+
"""
41+
go list -f '{{.Dir}}/...' -m | xargs go generate
42+
"""
43+
}
44+
new {
45+
name = "go test"
46+
run =
47+
"""
48+
go list -f '{{.Dir}}/...' -m | xargs go test
49+
"""
50+
}
51+
new {
52+
name = "pkl format"
53+
run =
54+
"""
55+
pkl format --diff-name-only .
56+
"""
57+
}
58+
}
59+
}
60+
["hawkeye-check"] = new HawkeyeCheck {}.job
61+
}
62+
}
63+
64+
prb = test
65+
66+
build = test
67+
68+
main = test

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Do not modify!
2+
# This file was generated from a template using https://github.com/StefMa/pkl-gha
3+
4+
name: Build
5+
'on':
6+
push:
7+
branches-ignore:
8+
- main
9+
- release/*
10+
tags-ignore:
11+
- '**'
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: false
15+
permissions:
16+
contents: read
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v5
22+
- uses: actions/setup-go@v6
23+
with:
24+
go-version: '1.25'
25+
- name: Setup Pkl
26+
id: setup-pkl
27+
env:
28+
PKL_VERSION: 0.30.0
29+
PKL_FILENAME: pkl
30+
PKL_DOWNLOAD_URL: https://github.com/apple/pkl/releases/download/0.30.0/pkl-linux-amd64
31+
shell: bash
32+
run: |-
33+
DIR="$(mktemp -d /tmp/pkl-$PKL_VERSION-XXXXXX)"
34+
PKL_EXEC="$DIR/$PKL_FILENAME"
35+
curl -sfL -o $PKL_EXEC "$PKL_DOWNLOAD_URL"
36+
chmod +x $PKL_EXEC
37+
echo "$DIR" >> "$GITHUB_PATH"
38+
echo "pkl_exec=$PKL_EXEC" >> "$GITHUB_OUTPUT"
39+
- name: go generate
40+
run: go list -f '{{.Dir}}/...' -m | xargs go generate
41+
- name: go test
42+
run: go list -f '{{.Dir}}/...' -m | xargs go test
43+
- name: pkl format
44+
run: pkl format --diff-name-only .
45+
hawkeye-check:
46+
name: hawkeye-check
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v5
50+
with:
51+
fetch-depth: 0
52+
- run: hawkeye check --config licenserc.toml --fail-if-unknown
53+
container:
54+
image: ghcr.io/korandoru/hawkeye@sha256:c3ab994c0d81f3d116aabf9afc534e18648e3e90d7525d741c1e99dd8166ec85

.github/workflows/main.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Do not modify!
2+
# This file was generated from a template using https://github.com/StefMa/pkl-gha
3+
4+
name: Build (main)
5+
'on':
6+
push:
7+
branches:
8+
- main
9+
tags-ignore:
10+
- '**'
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: false
14+
permissions:
15+
contents: read
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
- uses: actions/setup-go@v6
22+
with:
23+
go-version: '1.25'
24+
- name: Setup Pkl
25+
id: setup-pkl
26+
env:
27+
PKL_VERSION: 0.30.0
28+
PKL_FILENAME: pkl
29+
PKL_DOWNLOAD_URL: https://github.com/apple/pkl/releases/download/0.30.0/pkl-linux-amd64
30+
shell: bash
31+
run: |-
32+
DIR="$(mktemp -d /tmp/pkl-$PKL_VERSION-XXXXXX)"
33+
PKL_EXEC="$DIR/$PKL_FILENAME"
34+
curl -sfL -o $PKL_EXEC "$PKL_DOWNLOAD_URL"
35+
chmod +x $PKL_EXEC
36+
echo "$DIR" >> "$GITHUB_PATH"
37+
echo "pkl_exec=$PKL_EXEC" >> "$GITHUB_OUTPUT"
38+
- name: go generate
39+
run: go list -f '{{.Dir}}/...' -m | xargs go generate
40+
- name: go test
41+
run: go list -f '{{.Dir}}/...' -m | xargs go test
42+
- name: pkl format
43+
run: pkl format --diff-name-only .
44+
hawkeye-check:
45+
name: hawkeye-check
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v5
49+
with:
50+
fetch-depth: 0
51+
- run: hawkeye check --config licenserc.toml --fail-if-unknown
52+
container:
53+
image: ghcr.io/korandoru/hawkeye@sha256:c3ab994c0d81f3d116aabf9afc534e18648e3e90d7525d741c1e99dd8166ec85

0 commit comments

Comments
 (0)