Skip to content

Commit

Permalink
Merge branch 'develop' into feat-italic-correction
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Nov 18, 2023
2 parents 4e1be52 + 8decf5b commit a1ea6e8
Show file tree
Hide file tree
Showing 192 changed files with 7,172 additions and 5,881 deletions.
23 changes: 23 additions & 0 deletions .cargo/config.toml
@@ -0,0 +1,23 @@
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-args=-rdynamic"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-rdynamic"]

# Since autotools sets these and we are *not* forcing them here, this will not
# affect release builds. It will affect `cargo run`, `cargo clippy` and others
# making it easier to test locally since the Lua loader path and other
# resources will be relative to the current sources.
[env]
SILE_PATH = { value = "", relative = true }
CONFIGURE_DATADIR = { value = "", relative = true }

[target.'cfg(all())']
rustflags = [
# CLIPPY LINT SETTINGS
# This is a workaround to configure lints for the entire workspace, pending the ability to configure this via TOML.
# See: `https://github.com/rust-lang/cargo/issues/5034`
# `https://github.com/EmbarkStudios/rust-ecosystem/issues/22#issuecomment-947011395`
"-Asuspicious_double_ref_op",
"-Aclippy::ptr_arg",
]
46 changes: 22 additions & 24 deletions .cirrus.yml
Expand Up @@ -2,8 +2,8 @@ task:
name: Cirrus CI (FreeBSD)
freebsd_instance:
matrix:
- image_family: freebsd-13-0
- image_family: freebsd-12-3
- image_family: freebsd-13-2
- image_family: freebsd-12-4
env:
MAKEFLAGS: -j$(nproc) -Otarget
CFLAGS: -I/usr/local/include -fPIC
Expand All @@ -15,39 +15,37 @@ task:
fingerprint_script: cat Makefile-fonts
luarocks_cache:
folder: /usr/local/lib/luarocks
fingerprint_script: cat sile-dev-1.rockspec
fingerprint_script: cat sile.rockspec.in
luarocks_lua_cache:
folder: /usr/local/share/lua
fingerprint_script: cat sile-dev-1.rockspec
fingerprint_script: cat sile.rockspec.in
luarocks_lib_cache:
folder: /usr/local/lib/lua
fingerprint_script: cat sile-dev-1.rockspec
fingerprint_script: cat sile.rockspec.in
dependencies_script:
- pkg install -y autoconf automake fontconfig GentiumPlus git gmake harfbuzz libtool pkgconf png
- pkg install -y lua54 lua54-lpeg lua54-luafilesystem lua54-luarocks lua54-luasec lua54-luasocket
# lua54-luaexpat exists but seems boken on 13.0, system doesn't have expat 2.4+ so 1.5.x isn't an option either
- luarocks54 install luaexpat 1.4.1
- luarocks54 install cassowary
- luarocks54 install cldr
- luarocks54 install compat53
- luarocks54 install cosmo
- luarocks54 install fluent
- luarocks54 install linenoise
- luarocks54 install loadkit
- luarocks54 install lua-zlib
- luarocks54 install lua_cliargs
- luarocks54 install luaepnf
- luarocks54 install luarepl
- luarocks54 install luautf8
- luarocks54 install penlight
- luarocks54 install vstruct
- pkg install -y autoconf automake fontconfig GentiumPlus git gmake harfbuzz jq libtool pkgconf png rust
- pkg install -y luajit lua51-luaexpat lua51-lpeg lua51-luafilesystem lua51-luarocks lua51-luasec lua51-luasocket
- luarocks51 install cassowary
- luarocks51 install cldr
- luarocks51 install compat53
- luarocks51 install fluent
- luarocks51 install linenoise
- luarocks51 install loadkit
- luarocks51 install lua-zlib
- luarocks51 install lua_cliargs
- luarocks51 install luaepnf
- luarocks51 install luarepl
- luarocks51 install luautf8
- luarocks51 install penlight
- luarocks51 install vstruct
bootstrap_script:
- git fetch --prune --tags ||:
- ./bootstrap.sh
configure_script: |
./configure MAKE=gmake \
--enable-developer LUAROCKS=false LUACHECK=false BUSTED=false \
--enable-developer LUAROCKS=false LUACHECK=false BUSTED=false PDFINFO=false NIX=false \
--disable-font-variations \
--with-system-lua-sources \
--with-system-luarocks \
--without-manual
make_script:
Expand Down
21 changes: 17 additions & 4 deletions .editorconfig
Expand Up @@ -6,15 +6,28 @@ insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[{Makefile*,*.mk,*.mk.in}]
indent_style = tab
indent_size = 4

[*.m4]
indent_style = space
indent_size = 8

[*.md]
trim_trailing_whitespace = false

[{*.lua,*.lua.in,sile.in,*rockspec,.busted,.luacheckrc}]
indent_style = space
indent_size = 2
indent_size = 3
max_line_length = 120

[*rockspec]
max_line_length = 190

[*.pl]
indent_style = space
indent_size = 4
indent_size = 2

[makefile*]
indent_style = tab
[*.rs]
indent_size = 4
1 change: 1 addition & 0 deletions .envrc
@@ -0,0 +1 @@
use flake
41 changes: 23 additions & 18 deletions .github/workflows/build.yml
Expand Up @@ -3,16 +3,23 @@ name: Build
on: [ push, pull_request ]

concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

build-ubuntu:
strategy:
matrix:
configuration:
- [ 'dynamic', '' ]
- [ 'embeded', '--enable-embeded-resources' ]
- [ 'system', '--with-system-lua-sources' ]
runs-on: ubuntu-22.04
name: Build Ubuntu ${{ matrix.configuration[0] }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
Expand All @@ -27,21 +34,22 @@ jobs:
with:
path: |
lua_modules
key: luarocks-${{ hashFiles('Makefile-luarocks', 'sile-dev-1.rockspec') }}
- name: Fetch tags
run: |
git fetch --prune --tags ||:
key: luarocks-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install fonts-sil-gentiumplus libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev liblua5.3-dev libpng-dev lua5.3 lua-sec lua-socket lua-zlib-dev luarocks poppler-utils
sudo apt-get install fonts-sil-gentiumplus ghostscript graphviz jq libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev libluajit-5.1-dev libpng-dev luajit lua-sec lua-socket lua-zlib-dev luarocks poppler-utils
- name: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Configure
run: |
./bootstrap.sh
./configure \
--disable-font-variations \
--without-system-luarocks \
--with-manual
--with-manual \
${{ matrix.configuration[1] }}
echo "VERSION=$(./build-aux/git-version-gen .tarball-version)" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc) -Otarget" >> $GITHUB_ENV
- name: Make
Expand All @@ -58,7 +66,7 @@ jobs:
path: sile-${{ env.VERSION }}.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
if: github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v')
with:
body_path: sile-${{ env.VERSION }}.md
files: |
Expand All @@ -68,9 +76,10 @@ jobs:
build-nix:
runs-on: ubuntu-22.04
name: Build Nix
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
Expand All @@ -80,14 +89,10 @@ jobs:
.fonts
.sources
key: fonts-${{ hashFiles('Makefile-fonts') }}
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
uses: DeterminateSystems/nix-installer-action@v6
- name: Cache Nix dependencies
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Setup developer environment
run: |
nix develop --command ./bootstrap.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run ‘commitlint’ linter
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/coverage.yml
Expand Up @@ -3,7 +3,7 @@ name: Coverage
on: [ push, pull_request ]

concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Coverage slows down tests *a lot*.
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
Expand All @@ -31,10 +31,7 @@ jobs:
with:
path: |
lua_modules
key: luarocks-luajit-${{ hashFiles('Makefile-luarocks', 'sile-dev-1.rockspec') }}
- name: Fetch tags
run: |
git fetch --prune --tags ||:
key: luarocks-luajit-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Setup ‘lua’
uses: leafo/gh-actions-lua@v10
with:
Expand Down Expand Up @@ -63,10 +60,8 @@ jobs:
run: |
./bootstrap.sh
./configure \
--enable-developer LUACHECK=false \
--enable-developer LUACHECK=false NIX=false \
--disable-font-variations \
--without-system-luarocks \
--with-luajit \
--without-manual
- name: Make
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/deploy.yml
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- develop
- rel*
tags:
- latest
Expand All @@ -17,12 +18,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Configure
run: |
echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/luacheck.yml
Expand Up @@ -8,6 +8,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Luacheck
uses: lunarmodules/luacheck@v1
14 changes: 5 additions & 9 deletions .github/workflows/nix.yml
Expand Up @@ -3,7 +3,7 @@ name: Run Flake
on: [ push, pull_request ]

concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -12,17 +12,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Install Nix
uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
uses: DeterminateSystems/nix-installer-action@v6
- name: Cache Nix dependencies
uses: DeterminateSystems/magic-nix-cache-action@v2
# Upstream package sometimes has flags set that disable flake checking
- name: Setup test env
run: |
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/rust_lint.yml
@@ -0,0 +1,42 @@
name: Rust Lint

on: [ push, pull_request ]

jobs:

rustfmt:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Run rustfmt
run: |
git ls-files '*.rs' '*.rs.in' | xargs rustfmt --check --config skip_children=true
clippy:
strategy:
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- uses: actions-rs/clippy-check@v1
with:
token: ${{ github.token }}
args: --features luajit,vendored -- -D warnings

0 comments on commit a1ea6e8

Please sign in to comment.