Skip to content

Commit

Permalink
Merge 8ff8c62 into b4e2288
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Apr 18, 2024
2 parents b4e2288 + 8ff8c62 commit f08e5f2
Show file tree
Hide file tree
Showing 405 changed files with 12,120 additions and 8,142 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",
]
33 changes: 16 additions & 17 deletions .cirrus.yml
Expand Up @@ -23,29 +23,28 @@ task:
folder: /usr/local/lib/lua
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-luaexpat lua54-lpeg lua54-luafilesystem lua54-luarocks lua54-luasec lua54-luasocket
- 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 lua51-lzlib
- luarocks51 install cassowary
- luarocks51 install cldr
- luarocks51 install compat53
- luarocks51 install fluent
- luarocks51 install linenoise
- luarocks51 install loadkit
- 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 PDFINFO=false NIX=false \
--enable-developer-mode LDOC=false LUAROCKS=false LUACHECK=false BUSTED=false DELTA=cat PDFINFO=false NIX=false NPM=false DOCKER=false \
--disable-font-variations \
--with-system-lua-sources \
--with-system-luarocks \
--without-manual
make_script:
Expand Down
2 changes: 2 additions & 0 deletions .commitlintrc.yml
Expand Up @@ -39,6 +39,7 @@ rules:
- inputters
- installation
- languages
- api
- manpage
- manual
- math
Expand All @@ -53,6 +54,7 @@ rules:
- settings
- shapers
- tooling
- types
- typesetters
- utilities
help: |
Expand Down
23 changes: 18 additions & 5 deletions .editorconfig
Expand Up @@ -6,15 +6,28 @@ insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[{*.lua,*.lua.in,sile.in,*rockspec,.busted,.luacheckrc}]
[{Makefile*,*.mk,*.mk.in}]
indent_style = tab
indent_size = 4

[*.m4]
indent_style = space
indent_size = 2
indent_size = 8

[*.md]
trim_trailing_whitespace = false

[{*.lua,*.lua.in,sile.in,*rockspec,.busted,.luacheckrc,config.ld}]
indent_style = space
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
45 changes: 37 additions & 8 deletions .github/workflows/build.yml
Expand Up @@ -9,7 +9,15 @@ concurrency:
jobs:

build-ubuntu:
strategy:
matrix:
configuration:
- [ 'dynamic', '' ]
- [ 'system', '--with-system-lua-sources' ]
- [ 'embedded', '--enable-embedded-resources' ]
- [ 'static', '--enable-embedded-resources --disable-shared --enable-static' ]
runs-on: ubuntu-22.04
name: Build Ubuntu ${{ matrix.configuration[0] }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,43 +36,64 @@ jobs:
path: |
lua_modules
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 ghostscript graphviz 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 \
--enable-developer-mode \
BUSTED=false DELTA=false LDOC=false LUACHECK=false NIX=false \
--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
echo "CARCH=$(uname -m)" >> $GITHUB_ENV
- name: Make
run: |
make
- name: Package
run: |
make dist
- name: Upload artifacts
if: ${{ !contains(github.ref, 'refs/tags/v') }}
- name: Upload source dist artifact
if: ${{ matrix.configuration[0] == 'dynamic' && !contains(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: sile-${{ env.VERSION }}
path: sile-${{ env.VERSION }}.zip
- name: Append architecture to static binary
if: ${{ matrix.configuration[0] == 'static' }}
run: |
cp sile sile-${{ env.CARCH }}
sha256sum sile-${{ env.CARCH }} | tee -a sile-${{ env.VERSION }}.sha256.txt
- name: Upload static binary artifact
if: ${{ matrix.configuration[0] == 'static' && !contains(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: sile-${{ env.CARCH }}
path: sile-${{ env.CARCH }}
- name: Release
uses: softprops/action-gh-release@v2
if: github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v')
if: matrix.configuration[0] == 'static' && github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v')
with:
body_path: sile-${{ env.VERSION }}.md
files: |
sile-${{ env.VERSION }}.pdf
sile-${{ env.VERSION }}.zip
sile-${{ env.VERSION }}.tar.zst
sile-${{ env.CARCH }}
sile-${{ env.VERSION }}.sha256.txt
build-nix:
runs-on: ubuntu-22.04
name: Build Nix
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -86,6 +115,6 @@ jobs:
nix develop --command ./bootstrap.sh
nix develop --configure
nix develop --command make
- name: Run HB6+ only regressions
- name: Run regression tests for which Ubuntu can't provide deps
run: |
nix develop --command make regressions TESTSRCS=tests/variations-axis.sil
nix develop --command make regressions TESTSRCS='tests/variations-axis.sil tests/feat-unicode-softhyphen.sil'
4 changes: 1 addition & 3 deletions .github/workflows/coverage.yml
Expand Up @@ -60,10 +60,8 @@ jobs:
run: |
./bootstrap.sh
./configure \
--enable-developer LUACHECK=false NIX=false \
--enable-developer-mode LDOC=false LUACHECK=false NIX=false DELTA=cat \
--disable-font-variations \
--without-system-luarocks \
--with-luajit \
--without-manual
- name: Make
run: |
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/deploy.yml
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- develop
- rel*
tags:
- latest
Expand All @@ -20,11 +21,27 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install libluajit-5.1-dev luajit luarocks
- name: Configure
run: |
echo "REF=${GITHUB_REF##refs/*/}" >> $GITHUB_ENV
./bootstrap.sh
./configure --disable-dependency-checks --enable-developer
./configure \
--enable-developer-mode \
--without-harfbuzz \
--disable-font-variations \
BSDTAR=false \
BUSTED=false \
DELTA=false \
FCMATCH=true \
LDOC=false \
LUACHECK=false \
LUAROCKS=false \
NIX=false \
PDFINFO=false
- name: Publish Docker Image to GH Container Registry
run: |
make docker-build-push
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
13 changes: 11 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -39,6 +39,8 @@ jobs:
path: |
lua_modules
key: luarocks-${{ matrix.luaVersion[0] }}-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
Expand All @@ -48,6 +50,8 @@ jobs:
with:
luaVersion: ${{ matrix.luaVersion[0] }}
luaCompileFlags: ${{ matrix.luaVersion[1] }}
- name: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Setup ‘luarocks’
uses: leafo/gh-actions-luarocks@v4
- name: Prep system Lua for use
Expand All @@ -66,10 +70,11 @@ jobs:
run: |
./bootstrap.sh
./configure \
--enable-developer LUACHECK=false NIX=false \
${{ matrix.luaVersion[1] }} \
--enable-developer-mode LDOC=false LUACHECK=false NIX=false DELTA=cat \
--disable-font-variations \
--without-system-luarocks \
--with${{ !startsWith(matrix.luaVersion[0], 'luajit') && 'out' || '' }}-luajit \
--without-system-luarocks \
--without-manual
- name: Make
run: |
Expand All @@ -86,6 +91,10 @@ jobs:
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make regressions
- name: Test Cargo
timeout-minutes: ${{ runner.debug && 20 || 2 }}
run: |
make cargo-test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit f08e5f2

Please sign in to comment.