Skip to content

Fix some examples

Fix some examples #156

Workflow file for this run

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