Skip to content

Commit 9916262

Browse files
authored
Scala Native option (#8)
1 parent 1038bde commit 9916262

9 files changed

+310
-27
lines changed

.github/workflows/ci-scala-213.yml .github/workflows/ci-jvm-scala-213.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI (Scala 2.13)
1+
name: CI (JVM - Scala 2.13)
22

33
on:
44
push:
@@ -9,17 +9,17 @@ on:
99

1010
env:
1111
G8_PARAM_GITHUB_ORG: "octo-org"
12-
G8_PARAM_REPO_NAME: "simple-scala-cli-scala213"
12+
G8_PARAM_REPO_NAME: "simple-scala-cli-jvm-scala213"
1313
G8_PARAM_DEFAULT_BRANCH: "master"
1414

1515
concurrency:
16-
group: ${{ github.ref }}-scala213
16+
group: ${{ github.ref }}-jvm-scala213
1717
cancel-in-progress: true
1818

1919
jobs:
2020

2121
generate-project:
22-
name: Generate project (Scala 2.13)
22+
name: Generate project (JVM - Scala 2.13)
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 5
2525
steps:
@@ -28,6 +28,7 @@ jobs:
2828
run: |
2929
sbt new file://../simple-scala-cli.g8 \
3030
--use_scala_3=false \
31+
--use_scala_native=false \
3132
--name="${G8_PARAM_REPO_NAME}" \
3233
--github_org="${G8_PARAM_GITHUB_ORG}" \
3334
--default_branch="${G8_PARAM_DEFAULT_BRANCH}"
@@ -38,7 +39,7 @@ jobs:
3839
key: ${{ github.sha }}
3940

4041
gh-workflows-check:
41-
name: GitHub workflows check (Scala 2.13)
42+
name: GitHub workflows check (JVM - Scala 2.13)
4243
needs: generate-project
4344
runs-on: ubuntu-latest
4445
timeout-minutes: 2
@@ -60,7 +61,7 @@ jobs:
6061
xargs -n 1 -I ^ act --dryrun --platform "${ACT_PLATFORM}" -W ".github/workflows/^"
6162
6263
scalafmt-check:
63-
name: Scalafmt check (Scala 2.13)
64+
name: Scalafmt check (JVM - Scala 2.13)
6465
needs: generate-project
6566
runs-on: ubuntu-latest
6667
timeout-minutes: 1
@@ -82,7 +83,7 @@ jobs:
8283
)
8384
8485
scala-cli-tests:
85-
name: Run tests (Scala 2.13)
86+
name: Run tests (JVM - Scala 2.13)
8687
needs: generate-project
8788
runs-on: ubuntu-latest
8889
timeout-minutes: 2
@@ -100,7 +101,7 @@ jobs:
100101
scala-cli test .
101102
102103
upload-generated-project:
103-
name: Upload generated project (Scala 2.13)
104+
name: Upload generated project (JVM - Scala 2.13)
104105
if: github.ref == 'refs/heads/master'
105106
needs: [ gh-workflows-check, scalafmt-check, scala-cli-tests ]
106107
runs-on: ubuntu-latest

.github/workflows/ci-scala-3.yml .github/workflows/ci-jvm-scala-3.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI (Scala 3)
1+
name: CI (JVM - Scala 3)
22

33
on:
44
push:
@@ -9,17 +9,17 @@ on:
99

1010
env:
1111
G8_PARAM_GITHUB_ORG: "octo-org"
12-
G8_PARAM_REPO_NAME: "simple-scala-cli-scala3"
12+
G8_PARAM_REPO_NAME: "simple-scala-cli-jvm-scala3"
1313
G8_PARAM_DEFAULT_BRANCH: "master"
1414

1515
concurrency:
16-
group: ${{ github.ref }}-scala3
16+
group: ${{ github.ref }}-jvm-scala3
1717
cancel-in-progress: true
1818

1919
jobs:
2020

2121
generate-project:
22-
name: Generate project (Scala 3)
22+
name: Generate project (JVM - Scala 3)
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 5
2525
steps:
@@ -28,6 +28,7 @@ jobs:
2828
run: |
2929
sbt new file://../simple-scala-cli.g8 \
3030
--use_scala_3=true \
31+
--use_scala_native=false \
3132
--name="${G8_PARAM_REPO_NAME}" \
3233
--github_org="${G8_PARAM_GITHUB_ORG}" \
3334
--default_branch="${G8_PARAM_DEFAULT_BRANCH}"
@@ -38,7 +39,7 @@ jobs:
3839
key: ${{ github.sha }}
3940

4041
gh-workflows-check:
41-
name: GitHub workflows check (Scala 3)
42+
name: GitHub workflows check (JVM - Scala 3)
4243
needs: generate-project
4344
runs-on: ubuntu-latest
4445
timeout-minutes: 2
@@ -60,7 +61,7 @@ jobs:
6061
xargs -n 1 -I ^ act --dryrun --platform "${ACT_PLATFORM}" -W ".github/workflows/^"
6162
6263
scalafmt-check:
63-
name: Scalafmt check (Scala 3)
64+
name: Scalafmt check (JVM - Scala 3)
6465
needs: generate-project
6566
runs-on: ubuntu-latest
6667
timeout-minutes: 1
@@ -82,7 +83,7 @@ jobs:
8283
)
8384
8485
scala-cli-tests:
85-
name: Run tests (Scala 3)
86+
name: Run tests (JVM - Scala 3)
8687
needs: generate-project
8788
runs-on: ubuntu-latest
8889
timeout-minutes: 2
@@ -100,7 +101,7 @@ jobs:
100101
scala-cli test .
101102
102103
upload-generated-project:
103-
name: Upload generated project (Scala 3)
104+
name: Upload generated project (JVM - Scala 3)
104105
if: github.ref == 'refs/heads/master'
105106
needs: [ gh-workflows-check, scalafmt-check, scala-cli-tests ]
106107
runs-on: ubuntu-latest
+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: CI (Native - Scala 2.13)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch: # enable manual execution
9+
10+
env:
11+
G8_PARAM_GITHUB_ORG: "octo-org"
12+
G8_PARAM_REPO_NAME: "simple-scala-cli-native-scala213"
13+
G8_PARAM_DEFAULT_BRANCH: "master"
14+
15+
concurrency:
16+
group: ${{ github.ref }}-native-scala213
17+
cancel-in-progress: true
18+
19+
jobs:
20+
21+
generate-project:
22+
name: Generate project (Native - Scala 2.13)
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 5
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Generate project
28+
run: |
29+
sbt new file://../simple-scala-cli.g8 \
30+
--use_scala_3=false \
31+
--use_scala_native=true \
32+
--name="${G8_PARAM_REPO_NAME}" \
33+
--github_org="${G8_PARAM_GITHUB_ORG}" \
34+
--default_branch="${G8_PARAM_DEFAULT_BRANCH}"
35+
- name: Cache generated project
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ env.G8_PARAM_REPO_NAME }}
39+
key: ${{ github.sha }}
40+
41+
gh-workflows-check:
42+
name: GitHub workflows check (Native - Scala 2.13)
43+
needs: generate-project
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 2
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Get cached generated project
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.G8_PARAM_REPO_NAME }}
52+
key: ${{ github.sha }}
53+
- name: Setup act
54+
uses: actionsflow/setup-act@v1
55+
- name: GitHub workflows check
56+
env:
57+
ACT_PLATFORM: "ubuntu-latest=catthehacker/ubuntu:act-latest"
58+
run: |
59+
cd "${G8_PARAM_REPO_NAME}"
60+
ls ".github/workflows" | \
61+
xargs -n 1 -I ^ act --dryrun --platform "${ACT_PLATFORM}" -W ".github/workflows/^"
62+
63+
scalafmt-check:
64+
name: Scalafmt check (Native - Scala 2.13)
65+
needs: generate-project
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 1
68+
steps:
69+
- name: Get cached generated project
70+
uses: actions/cache@v4
71+
with:
72+
path: ${{ env.G8_PARAM_REPO_NAME }}
73+
key: ${{ github.sha }}
74+
- uses: coursier/cache-action@v6
75+
- uses: VirtusLab/scala-cli-setup@v1
76+
- name: Scalafmt check
77+
run: |
78+
cd "${G8_PARAM_REPO_NAME}"
79+
scala-cli fmt --check . || (
80+
echo "To format code run"
81+
echo " scala-cli fmt ."
82+
exit 1
83+
)
84+
85+
scala-cli-tests:
86+
name: Run tests (Native - Scala 2.13)
87+
needs: generate-project
88+
runs-on: ubuntu-latest
89+
timeout-minutes: 2
90+
steps:
91+
- name: Get cached generated project
92+
uses: actions/cache@v4
93+
with:
94+
path: ${{ env.G8_PARAM_REPO_NAME }}
95+
key: ${{ github.sha }}
96+
- uses: coursier/cache-action@v6
97+
- uses: VirtusLab/scala-cli-setup@v1
98+
- name: Run tests
99+
run: |
100+
cd "${G8_PARAM_REPO_NAME}"
101+
scala-cli test .
102+
103+
upload-generated-project:
104+
name: Upload generated project (Native - Scala 2.13)
105+
if: github.ref == 'refs/heads/master'
106+
needs: [ gh-workflows-check, scalafmt-check, scala-cli-tests ]
107+
runs-on: ubuntu-latest
108+
timeout-minutes: 1
109+
steps:
110+
- name: Get cached generated project
111+
uses: actions/cache@v4
112+
with:
113+
path: ${{ env.G8_PARAM_REPO_NAME }}
114+
key: ${{ github.sha }}
115+
- name: Upload generated project
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: ${{ env.G8_PARAM_REPO_NAME }}
119+
path: |
120+
${{ env.G8_PARAM_REPO_NAME }}/
121+
!${{ env.G8_PARAM_REPO_NAME }}/.bsp
122+
!${{ env.G8_PARAM_REPO_NAME }}/.scala-build
123+
if-no-files-found: error
124+
retention-days: 5
+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: CI (Native - Scala 3)
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch: # enable manual execution
9+
10+
env:
11+
G8_PARAM_GITHUB_ORG: "octo-org"
12+
G8_PARAM_REPO_NAME: "simple-scala-cli-native-scala3"
13+
G8_PARAM_DEFAULT_BRANCH: "master"
14+
15+
concurrency:
16+
group: ${{ github.ref }}-native-scala3
17+
cancel-in-progress: true
18+
19+
jobs:
20+
21+
generate-project:
22+
name: Generate project (Native - Scala 3)
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 5
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Generate project
28+
run: |
29+
sbt new file://../simple-scala-cli.g8 \
30+
--use_scala_3=true \
31+
--use_scala_native=true \
32+
--name="${G8_PARAM_REPO_NAME}" \
33+
--github_org="${G8_PARAM_GITHUB_ORG}" \
34+
--default_branch="${G8_PARAM_DEFAULT_BRANCH}"
35+
- name: Cache generated project
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ env.G8_PARAM_REPO_NAME }}
39+
key: ${{ github.sha }}
40+
41+
gh-workflows-check:
42+
name: GitHub workflows check (Native - Scala 3)
43+
needs: generate-project
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 2
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Get cached generated project
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.G8_PARAM_REPO_NAME }}
52+
key: ${{ github.sha }}
53+
- name: Setup act
54+
uses: actionsflow/setup-act@v1
55+
- name: GitHub workflows check
56+
env:
57+
ACT_PLATFORM: "ubuntu-latest=catthehacker/ubuntu:act-latest"
58+
run: |
59+
cd "${G8_PARAM_REPO_NAME}"
60+
ls ".github/workflows" | \
61+
xargs -n 1 -I ^ act --dryrun --platform "${ACT_PLATFORM}" -W ".github/workflows/^"
62+
63+
scalafmt-check:
64+
name: Scalafmt check (Native - Scala 3)
65+
needs: generate-project
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 1
68+
steps:
69+
- name: Get cached generated project
70+
uses: actions/cache@v4
71+
with:
72+
path: ${{ env.G8_PARAM_REPO_NAME }}
73+
key: ${{ github.sha }}
74+
- uses: coursier/cache-action@v6
75+
- uses: VirtusLab/scala-cli-setup@v1
76+
- name: Scalafmt check
77+
run: |
78+
cd "${G8_PARAM_REPO_NAME}"
79+
scala-cli fmt --check . || (
80+
echo "To format code run"
81+
echo " scala-cli fmt ."
82+
exit 1
83+
)
84+
85+
scala-cli-tests:
86+
name: Run tests (Native - Scala 3)
87+
needs: generate-project
88+
runs-on: ubuntu-latest
89+
timeout-minutes: 2
90+
steps:
91+
- name: Get cached generated project
92+
uses: actions/cache@v4
93+
with:
94+
path: ${{ env.G8_PARAM_REPO_NAME }}
95+
key: ${{ github.sha }}
96+
- uses: coursier/cache-action@v6
97+
- uses: VirtusLab/scala-cli-setup@v1
98+
- name: Run tests
99+
run: |
100+
cd "${G8_PARAM_REPO_NAME}"
101+
scala-cli test .
102+
103+
upload-generated-project:
104+
name: Upload generated project (Native - Scala 3)
105+
if: github.ref == 'refs/heads/master'
106+
needs: [ gh-workflows-check, scalafmt-check, scala-cli-tests ]
107+
runs-on: ubuntu-latest
108+
timeout-minutes: 1
109+
steps:
110+
- name: Get cached generated project
111+
uses: actions/cache@v4
112+
with:
113+
path: ${{ env.G8_PARAM_REPO_NAME }}
114+
key: ${{ github.sha }}
115+
- name: Upload generated project
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: ${{ env.G8_PARAM_REPO_NAME }}
119+
path: |
120+
${{ env.G8_PARAM_REPO_NAME }}/
121+
!${{ env.G8_PARAM_REPO_NAME }}/.bsp
122+
!${{ env.G8_PARAM_REPO_NAME }}/.scala-build
123+
if-no-files-found: error
124+
retention-days: 5

0 commit comments

Comments
 (0)