Skip to content

Commit 3634e42

Browse files
committed
add scripts
1 parent a3c8c6a commit 3634e42

28 files changed

+1310
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: "build patched libs"
2+
3+
jobs:
4+
build-cosmocc:
5+
name: "build cosmocc and static lib deps"
6+
runs-on: ubuntu-24.04
7+
steps:
8+
- name: "clone repo"
9+
uses: actions/checkout@v4
10+
- name: "setup qemu and requirements"
11+
run: bash scripts/setup-requirements.sh
12+
- name: "get boot/mx labs jdk"
13+
run: ARCH=x86_64 make get-boot-jdk get-mx-labs-jdk
14+
- name: "build cosmocc"
15+
run: make build-deps-labs collect-cosmocc
16+
- name: "build labs JDK static libs (aarch64)"
17+
run: |
18+
rm -f results/build-graal-helpers.complete
19+
rm -f results/collect-graal-helpers.complete
20+
rm -f results/build-labs-jdk.complete
21+
rm -f results/collect-labs-jdk.complete
22+
ARCH=aarch64 make collect-labs-jdk collect-graal-helpers
23+
- name: "build labs JDK static libs (x86_64)"
24+
run: |
25+
rm -f results/build-graal-helpers.complete
26+
rm -f results/collect-graal-helpers.complete
27+
rm -f results/build-labs-jdk.complete
28+
rm -f results/collect-labs-jdk.complete
29+
ARCH=x86_64 make collect-labs-jdk collect-graal-helpers
30+
- name: "upload cosmocc"
31+
uses: actions/upload-artifact@v6
32+
with:
33+
name: cosmocc-${{ github.sha }}
34+
overwrite: true
35+
path: ./build/cosmocc.zip
36+
compression-level: 0
37+
- name: "upload labs JDK x86_64 libs"
38+
uses: actions/upload-artifact@v6
39+
with:
40+
name: labs-x86_64-libs-${{ github.sha }}
41+
overwrite: true
42+
path: ./build/labs-x86_64-cosmo-libs.zip
43+
compression-level: 0
44+
- name: "upload graal helper x86_64 libs"
45+
uses: actions/upload-artifact@v6
46+
with:
47+
name: graal-x86_64-libs-${{ github.sha }}
48+
overwrite: true
49+
path: ./build/graal-x86_64-helpers.zip
50+
compression-level: 0
51+
- name: "upload labs JDK aarch64 libs"
52+
uses: actions/upload-artifact@v6
53+
with:
54+
name: labs-aarch64-libs-${{ github.sha }}
55+
overwrite: true
56+
path: ./build/labs-aarch64-cosmo-libs.zip
57+
compression-level: 0
58+
- name: "upload graal helper aarch64 libs"
59+
uses: actions/upload-artifact@v6
60+
with:
61+
name: graal-aarch64-libs-${{ github.sha }}
62+
overwrite: true
63+
path: ./build/graal-aarch64-helpers.zip
64+
compression-level: 0
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: "build envmap example (end-to-end)"
2+
3+
jobs:
4+
build-cosmocc:
5+
name: "build cosmocc and static lib deps"
6+
runs-on: ubuntu-24.04
7+
steps:
8+
- name: "clone repo"
9+
uses: actions/checkout@v4
10+
- name: "setup qemu and requirements"
11+
run: bash scripts/setup-requirements.sh
12+
- name: "get boot/mx labs jdk"
13+
run: ARCH=x86_64 make get-boot-jdk get-mx-labs-jdk
14+
- name: "build cosmocc"
15+
run: make build-deps-labs collect-cosmocc
16+
- name: "build labs JDK static libs (aarch64)"
17+
run: |
18+
rm -f results/build-graal-helpers.complete
19+
rm -f results/collect-graal-helpers.complete
20+
rm -f results/build-labs-jdk.complete
21+
rm -f results/collect-labs-jdk.complete
22+
ARCH=aarch64 make collect-labs-jdk collect-graal-helpers
23+
- name: "build labs JDK static libs (x86_64)"
24+
run: |
25+
rm -f results/build-graal-helpers.complete
26+
rm -f results/collect-graal-helpers.complete
27+
rm -f results/build-labs-jdk.complete
28+
rm -f results/collect-labs-jdk.complete
29+
ARCH=x86_64 make collect-labs-jdk collect-graal-helpers
30+
- name: "upload cosmocc"
31+
uses: actions/upload-artifact@v6
32+
with:
33+
name: cosmocc
34+
overwrite: true
35+
path: ./build/cosmocc.zip
36+
compression-level: 0
37+
- name: "upload labs JDK x86_64 libs"
38+
uses: actions/upload-artifact@v6
39+
with:
40+
name: labs-x86_64-libs
41+
overwrite: true
42+
path: ./build/labs-x86_64-cosmo-libs.zip
43+
compression-level: 0
44+
- name: "upload graal helper x86_64 libs"
45+
uses: actions/upload-artifact@v6
46+
with:
47+
name: graal-x86_64-libs
48+
overwrite: true
49+
path: ./build/graal-x86_64-helpers.zip
50+
compression-level: 0
51+
- name: "upload labs JDK aarch64 libs"
52+
uses: actions/upload-artifact@v6
53+
with:
54+
name: labs-aarch64-libs
55+
overwrite: true
56+
path: ./build/labs-aarch64-cosmo-libs.zip
57+
compression-level: 0
58+
- name: "upload graal helper aarch64 libs"
59+
uses: actions/upload-artifact@v6
60+
with:
61+
name: graal-aarch64-libs
62+
overwrite: true
63+
path: ./build/graal-aarch64-helpers.zip
64+
compression-level: 0
65+
build-via-native-image:
66+
name: "build envmap via native-image"
67+
needs: [build-cosmocc]
68+
strategy:
69+
fail-fast: true
70+
matrix:
71+
include:
72+
- platform: ubuntu-24.04
73+
arch: 'x86_64'
74+
- platform: ubuntu-24.04-arm
75+
arch: 'aarch64'
76+
runs-on: ${{ matrix.platform }}
77+
steps:
78+
- name: "clone repo"
79+
uses: actions/checkout@v4
80+
- name: "setup qemu and requirements"
81+
run: bash scripts/setup-requirements.sh
82+
- name: "download cosmocc"
83+
uses: actions/download-artifact@v7
84+
with:
85+
name: cosmocc
86+
- name: "download labs JDK libs"
87+
uses: actions/download-artifact@v7
88+
with:
89+
name: labs-${{ matrix.arch }}-libs
90+
- name: "download graal helper libs"
91+
uses: actions/download-artifact@v7
92+
with:
93+
name: graal-${{ matrix.arch }}-libs
94+
- name: "build native image from source"
95+
run: make ARCH=${{ matrix.arch }} build-native-image
96+
- name: "setup downloaded artifacts"
97+
run: ARCH=${{ matrix.arch }} bash scripts/download-partials-setup.sh
98+
- name: "build envmap example"
99+
run: make ARCH=${{ matrix.arch }} build-envmap-example
100+
- name: "upload envmap example"
101+
uses: actions/upload-artifact@v6
102+
with:
103+
name: envmap-${{ matrix.arch }}
104+
overwrite: true
105+
path: ./build/envmap.${{ matrix.arch }}
106+
compression-level: 0
107+
build-ape:
108+
name: "build envmap APE"
109+
needs: [build-via-native-image]
110+
runs-on: ubuntu-24.04
111+
steps:
112+
- name: "clone repo"
113+
uses: actions/checkout@v4
114+
- name: "setup qemu and requirements"
115+
run: bash scripts/setup-requirements.sh
116+
- name: "get cosmocc artifact"
117+
uses: actions/download-artifact@v7
118+
with:
119+
name: cosmocc
120+
- name: "get x86_64 envmap artifact"
121+
uses: actions/download-artifact@v7
122+
with:
123+
name: envmap-x86_64
124+
- name: "get aarch64 envmap artifact"
125+
uses: actions/download-artifact@v7
126+
with:
127+
name: envmap-aarch64
128+
- name: "setup cosmocc"
129+
run: |
130+
mkdir -p testing/cosmopolitan
131+
cd testing/cosmopolitan
132+
unzip -qo ../../cosmocc.zip
133+
cd ../../
134+
- name: "build APE"
135+
run: bash scripts/apelinkpls.sh envmap
136+
- name: "upload envmap APE"
137+
uses: actions/upload-artifact@v6
138+
with:
139+
name: envmap-APE
140+
overwrite: true
141+
path: ./envmap.com
142+
compression-level: 0
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: "build envmap example (w/ patched libs)"
2+
3+
# to access artifacts from the patched libs action
4+
permissions:
5+
contents: read
6+
actions: read
7+
8+
jobs:
9+
build-via-native-image:
10+
name: "build envmap via native-image"
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
include:
15+
- platform: ubuntu-24.04
16+
arch: 'x86_64'
17+
- platform: ubuntu-24.04-arm
18+
arch: 'aarch64'
19+
runs-on: ${{ matrix.platform }}
20+
steps:
21+
- name: "clone repo"
22+
uses: actions/checkout@v4
23+
- name: "download cosmocc"
24+
uses: actions/download-artifact@v7
25+
with:
26+
run-id: TBD
27+
name: cosmocc
28+
github-token: ${{ github.token }}
29+
- name: "download labs JDK libs"
30+
uses: actions/download-artifact@v7
31+
with:
32+
run-id: TBD
33+
name: labs-${{ matrix.arch }}-libs
34+
github-token: ${{ github.token }}
35+
- name: "download graal helper libs"
36+
uses: actions/download-artifact@v7
37+
with:
38+
run-id: TBD
39+
name: graal-${{ matrix.arch }}-libs
40+
github-token: ${{ github.token }}
41+
- name: "build native image from source"
42+
run: make ARCH=${{ matrix.arch }} build-native-image
43+
- name: "setup downloaded artifacts"
44+
run: ARCH=${{ matrix.arch }} bash scripts/download-partials-setup.sh
45+
- name: "build envmap example"
46+
run: make ARCH=${{ matrix.arch }} build-envmap-example
47+
- name: "upload envmap example"
48+
uses: actions/upload-artifact@v6
49+
with:
50+
name: envmap-${{ matrix.arch }}
51+
overwrite: true
52+
path: ./build/envmap.${{ matrix.arch }}
53+
compression-level: 0
54+
build-ape:
55+
name: "build envmap APE"
56+
needs: [build-via-native-image]
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- name: "clone repo"
60+
uses: actions/checkout@v4
61+
- name: "get cosmocc artifact"
62+
uses: actions/download-artifact@v7
63+
with:
64+
run-id: TBD
65+
name: cosmocc
66+
github-token: ${{ github.token }}
67+
- name: "get x86_64 envmap artifact"
68+
uses: actions/download-artifact@v7
69+
with:
70+
name: envmap-x86_64
71+
- name: "get aarch64 envmap artifact"
72+
uses: actions/download-artifact@v7
73+
with:
74+
name: envmap-aarch64
75+
- name: "setup cosmocc"
76+
run: |
77+
mkdir -p testing/cosmopolitan
78+
cd testing/cosmopolitan
79+
unzip -qo ../../cosmocc.zip
80+
cd ../../
81+
- name: "build APE"
82+
run: bash scripts/apelinkpls.sh envmap
83+
- name: "upload envmap APE"
84+
uses: actions/upload-artifact@v6
85+
with:
86+
name: envmap-APE
87+
overwrite: true
88+
path: ./envmap.com
89+
compression-level: 0
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: "build google-java-format (w/patched libs)"
2+
3+
# to access artifacts from the patched libs action
4+
permissions:
5+
contents: read
6+
actions: read
7+
8+
jobs:
9+
build-via-native-image:
10+
name: "build google-java-format via native-image"
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
include:
15+
- platform: ubuntu-24.04
16+
arch: 'x86_64'
17+
- platform: ubuntu-24.04-arm
18+
arch: 'aarch64'
19+
runs-on: ${{ matrix.platform }}
20+
steps:
21+
- name: "clone repo"
22+
uses: actions/checkout@v4
23+
- name: "download cosmocc"
24+
uses: actions/download-artifact@v7
25+
with:
26+
run-id: TBD
27+
name: cosmocc
28+
github-token: ${{ github.token }}
29+
- name: "download labs JDK libs"
30+
uses: actions/download-artifact@v7
31+
with:
32+
run-id: TBD
33+
name: labs-${{ matrix.arch }}-libs
34+
github-token: ${{ github.token }}
35+
- name: "download graal helper libs"
36+
uses: actions/download-artifact@v7
37+
with:
38+
run-id: TBD
39+
name: graal-${{ matrix.arch }}-libs
40+
github-token: ${{ github.token }}
41+
- name: "build native image from source"
42+
run: make ARCH=${{ matrix.arch }} build-native-image
43+
- name: "setup downloaded artifacts"
44+
run: ARCH=${{ matrix.arch }} bash scripts/download-partials-setup.sh
45+
- name: "build google-java-format"
46+
run: make ARCH=${{ matrix.arch }} build-google-java-format
47+
- name: "upload google-java-format"
48+
uses: actions/upload-artifact@v6
49+
with:
50+
name: google-java-format-${{ matrix.arch }}
51+
overwrite: true
52+
path: ./build/google-java-format.${{ matrix.arch }}
53+
compression-level: 0
54+
build-ape:
55+
name: "build APE"
56+
needs: [build-via-native-image]
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- name: "clone repo"
60+
uses: actions/checkout@v4
61+
- name: "get cosmocc artifact"
62+
uses: actions/download-artifact@v7
63+
with:
64+
run-id: TBD
65+
name: cosmocc
66+
github-token: ${{ github.token }}
67+
- name: "get x86_64 google-java-format artifact"
68+
uses: actions/download-artifact@v7
69+
with:
70+
name: google-java-format-x86_64
71+
- name: "get aarch64 google-java-format artifact"
72+
uses: actions/download-artifact@v7
73+
with:
74+
name: google-java-format-aarch64
75+
- name: "setup cosmocc"
76+
run: |
77+
mkdir -p testing/cosmopolitan
78+
cd testing/cosmopolitan
79+
unzip -qo ../../cosmocc.zip
80+
cd ../../
81+
- name: "build APE"
82+
run: bash scripts/apelinkpls.sh google-java-format
83+
- name: "upload APE"
84+
uses: actions/upload-artifact@v6
85+
with:
86+
name: google-java-format-APE
87+
overwrite: true
88+
path: ./google-java-format.com
89+
compression-level: 0

0 commit comments

Comments
 (0)