-
Notifications
You must be signed in to change notification settings - Fork 219
135 lines (132 loc) · 4.65 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build
on:
push:
branches:
- 'master'
tags:
# this is _not_ a regex, see: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
workflow_dispatch:
inputs:
release:
description: 'Make release'
jobs:
setup:
name: Set up
runs-on: ubuntu-22.04
outputs:
VERSION: ${{ steps.setup.outputs.VERSION }}
DOING_RELEASE: ${{ steps.setup.outputs.DOING_RELEASE }}
steps:
- name: Set up env vars
id: setup
shell: bash
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)\?[0-9]*\)\?$' || true)
echo "DOING_RELEASE=${DOING_RELEASE}" >> $GITHUB_OUTPUT
echo $VERSION
echo $DOING_RELEASE
build:
name: Build on ${{ matrix.build }}
runs-on: ${{ matrix.os }}
needs: setup
strategy:
fail-fast: false
matrix:
include:
- build: macos-x64
os: macos-11
- build: windows-x64
os: windows-2019
- build: linux-x64
os: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.69
- name: Check that build.py is up to date
run: |
python3 ./build.py
git update-index --refresh
git diff-index --quiet HEAD -- || exit 1;
- name: Check azul-css
run: cargo check --verbose --manifest-path azul-css/Cargo.toml
- name: Check azul-core
run: cargo check --verbose --manifest-path azul-core/Cargo.toml
- name: Check azul-css-parser
run: cargo check --verbose --manifest-path azul-css-parser/Cargo.toml
- name: Check azul-text-layout
run: cargo check --verbose --manifest-path azul-text-layout/Cargo.toml
- name: Check azul-layout
run: cargo check --verbose --manifest-path azul-layout/Cargo.toml
- name: Check azulc
run: cargo check --verbose --manifest-path azulc/Cargo.toml
- name: Check azul-desktop
run: cargo check --verbose --manifest-path azul-desktop/Cargo.toml
- name: Check azul-dll
run: cargo check --verbose --manifest-path azul-dll/Cargo.toml
- name: Install dependencies (Linux)
if: matrix.build == 'linux-x64'
run: sudo apt install clang
- name: Check azul.h (Linux)
if: matrix.build == 'linux-x64'
run: clang api/c/azul.h -ferror-limit=0
- name: Build DLL
run: cargo build --release --manifest-path azul-dll/Cargo.toml --features="link-dynamic, python-extension"
- name: Compile Rust examples
run: cargo check --verbose --examples --all-features
- name: Compile C examples
run: exit 0; # TODO
- name: Compile C++ examples
run: exit 0; # TODO
- name: Compile Python examples
if: matrix.build == 'windows-x64'
shell: bash
run: |
cp `pwd`/target/release/azul.dll `pwd`/target/release/azul.pyd
export PATH=`pwd`/target/release:$PATH
python3 examples/python/hello-world.py
exit 0; # TODO
- name: Run layout tests
run: exit 0; # TODO
- name: Build azulc
run: cargo build --release --bin azulc --manifest-path azulc/Cargo.toml --features="xml, std, font_loading, image_loading, gif, jpeg, png, tiff, bmp, text_layout"
- name: Upload Artifacts (Linux)
uses: actions/upload-artifact@v3
if: matrix.build == 'linux-x64'
with:
name: 'azul-linux-amd64'
path: |
target/release/azulc
target/release/libazul.so
target/release/libazul.a
retention-days: 2
if-no-files-found: error
- name: Upload Artifacts (Windows)
uses: actions/upload-artifact@v3
if: matrix.build == 'windows-x64'
with:
name: 'azul-windows-amd64'
path: |
target/release/azulc
target/release/azul.dll
target/release/libazul.a
target/release/azul.dll.lib
retention-days: 2
if-no-files-found: error
- name: Upload Artifacts (Mac)
uses: actions/upload-artifact@v3
if: matrix.build == 'macos-x64'
with:
name: 'azul-windows-amd64'
path: |
target/release/azulc
target/release/azul.dylib
target/release/libazul.a
retention-days: 2
if-no-files-found: error