mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
e3ccb26d66
Removing verbose it's okay, I'm not sure if cargo test tests linking the same binary as cargo build. So I'm not sure if it should be tested, furthermore maybe it makes sense to test in release mode rather than debug mode? Co-authored-by: June <61218022+itsjunetime@users.noreply.github.com>
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Setup sccache
|
|
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
|
uses: mozilla-actions/sccache-action@v0.0.6
|
|
- name: Configure sccache
|
|
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
|
run: |
|
|
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
|
|
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y cmake libjpeg-dev libfontconfig1-dev libopenjp2-7-dev libglib2.0-dev libnss3-dev
|
|
- name: Build newer poppler
|
|
run: |
|
|
wget https://poppler.freedesktop.org/poppler-23.12.0.tar.xz
|
|
tar xf poppler-23.12.0.tar.xz
|
|
cd poppler-23.12.0
|
|
mkdir build && cd build
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
|
|
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
|
|
-DENABLE_GPGME=OFF \
|
|
-DENABLE_QT5=OFF \
|
|
-DENABLE_QT6=OFF \
|
|
-DENABLE_BOOST=OFF \
|
|
-DENABLE_SPLASH=OFF \
|
|
-DENABLE_LIBCURL=OFF
|
|
make -j$(nproc)
|
|
sudo make install
|
|
sudo ldconfig
|
|
- uses: actions/checkout@v4
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
- name: Run tests
|
|
run: cargo test
|