Skip to content

Commit 2f200b2

Browse files
author
KDr2
committed
memlayout workflow
1 parent 82de1b0 commit 2f200b2

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: MemLayout Info Generating
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
continue-on-error: true
11+
strategy:
12+
matrix:
13+
version:
14+
- '1.3.1'
15+
- '1.4.2'
16+
- '1.5.3'
17+
- '1.5.4'
18+
- '1.6.1'
19+
os:
20+
- ubuntu-latest
21+
- windows-latest
22+
- macOS-latest
23+
arch:
24+
- x64
25+
- x86
26+
exclude:
27+
- os: macOS-latest
28+
arch: x86
29+
steps:
30+
- name: Set up MinGW
31+
uses: egor-tensin/setup-mingw@v2
32+
with:
33+
platform: i686
34+
cc: 1
35+
if: ${{ matrix.os == 'windows-latest' && matrix.arch == 'x86' }}
36+
- uses: actions/checkout@v2
37+
- uses: julia-actions/setup-julia@v1
38+
with:
39+
version: ${{ matrix.version }}
40+
arch: ${{ matrix.arch }}
41+
- run: julia .github/workflows/memlayout.jl
42+
- uses: EndBug/add-and-commit@v7
43+
with:
44+
add: 'src/memlayout'
45+
author_name: GitHub Actions
File renamed without changes.

.github/workflows/memlayout.jl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const ARCH = @static if string(Sys.ARCH)[1] == 'i'
2+
"x86"
3+
else
4+
string(Sys.ARCH)
5+
end
6+
7+
const PLATFORM = @static if Sys.islinux()
8+
"linux-" * ARCH
9+
elseif Sys.iswindows()
10+
"windows-" * ARCH
11+
elseif Sys.isapple()
12+
"darwin-" * ARCH
13+
end
14+
15+
OUTPUT = "$(PLATFORM)-v$(VERSION.major)_$(VERSION.minor)_$(VERSION.patch).jl"
16+
17+
const PROJECT_DIR = (@__DIR__) |> dirname |> dirname
18+
const INCLUDE = joinpath(dirname(Sys.BINDIR), "include/julia")
19+
const OPTIONS = if string(Sys.ARCH)[1] == 'i'
20+
Sys.islinux() && run(`sudo apt-get install g++-multilib -y`)
21+
["-std=c++11","-march=pentium4", "-m32", "-static-libgcc", "-static-libstdc++"]
22+
else
23+
["-std=c++11"]
24+
end
25+
26+
run(`g++ $(OPTIONS) -I$(INCLUDE) $(PROJECT_DIR)/.github/workflows/memlayout.cpp -o memlayout`)
27+
run(`./memlayout`)
28+
29+
if isfile(OUTPUT) and !isfile(joinpath("src/memlayout", OUTPUT))
30+
Base.Filesystem.mv(OUTPUT, joinpath("src/memlayout", OUTPUT))
31+
end

0 commit comments

Comments
 (0)