Skip to content

Commit 9ceb29c

Browse files
authored
Add packagecompiler CI (#54)
* Add build env * Fix spacing * Fix CI * Fix context * Move dockerfile * Fix path * Add push * Add upload binaries * Put PackageCompiler to self-hosted runner * Fix paths * Fix args * Run package compile nightly * Run docker container with current user
1 parent 45fb97d commit 9ceb29c

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.github/workflows/PackageCompiler.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PackageCompiler
2+
on:
3+
schedule:
4+
- cron: "0 3 * * *"
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
runs-on: self-hosted
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v2
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v2
18+
with:
19+
username: ${{ vars.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Build and push Docker image
23+
uses: docker/build-push-action@v2
24+
with:
25+
push: true
26+
context: "{{defaultContext}}:packagecompiler"
27+
file: Dockerfile
28+
tags: danlooo/julia_package_compiler_dev:latest
29+
cache-from: type=registry,ref=danlooo/julia_package_compiler_dev:cache
30+
cache-to: type=registry,ref=danlooo/julia_package_compiler_dev:cache,mode=max
31+
32+
- name: Run Docker container
33+
run: docker run \
34+
-v $PWD:/work \
35+
-u $(id -u ${USER}):$(id -g ${USER}) \
36+
danlooo/julia_package_compiler_dev:latest /work
37+
38+
- name: Upload binaries
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: binaries
42+
path: packagecompiler/app

packagecompiler/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM julia:1.11.3-bookworm
2+
3+
WORKDIR /app
4+
ENV JULIA_NUM_THREADS=auto
5+
ENV JULIA_DEPOT_PATH=/.julia
6+
7+
RUN apt-get update && apt-get install -y build-essential
8+
COPY Project.toml /.julia/environments/v1.11/
9+
RUN julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.status()'
10+
COPY run.jl ./
11+
ENTRYPOINT [ "./run.jl" ]

packagecompiler/run.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env -S julia --threads=auto
2+
3+
using PackageCompiler
4+
5+
dir = ARGS
6+
7+
PackageCompiler.create_app(dir, "$dir/packagecompiler/app";
8+
precompile_statements_file="$dir/packagecompiler/precompile_statements.jl",
9+
# see https://github.com/JuliaLang/PackageCompiler.jl/issues/994
10+
include_lazy_artifacts=true,
11+
# or try the following, which may work because IntelOpenMP and MKL may actually not be needed
12+
# include_transitive_dependencies=false,
13+
)
14+
# lets have an easy check whether this actually worked
15+
touch("$dir/packagecompiler/app/done")

0 commit comments

Comments
 (0)