Modify prebuild workflow (#54) #157
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: C/C++ CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| id: checkout-code | |
| name: Checkout | |
| - uses: actions/setup-node@v4 | |
| name: Setup Node | |
| with: | |
| node-version: '18' | |
| - id: dependencies | |
| name: Build Dependencies | |
| run: sudo apt-get update && sudo apt-get install -y build-essential python3 pkg-config | |
| - id: get-libjpeg | |
| name: Get libjpeg | |
| run: curl -fsSL http://www.ijg.org/files/jpegsrc.v9d.tar.gz -o jpegsrc.v9d.tar.gz | |
| - id: install-libjpeg | |
| name: Install libjpeg | |
| run: tar xzf jpegsrc.v9d.tar.gz && cd jpeg-9d && ./configure --with-pic && make -j"$(nproc)" && sudo make install | |
| - id: get-libraw | |
| name: Download LibRaw Release | |
| run: curl -fsSL https://www.libraw.org/data/LibRaw-0.21.2.tar.gz -o LibRaw-0.21.2.tar.gz | |
| - id: install-libraw | |
| name: Install LibRaw | |
| run: tar xzf LibRaw-0.21.2.tar.gz && cd LibRaw-0.21.2 && ./configure --with-pic --disable-openmp && make -j"$(nproc)" && sudo make install | |
| - id: pkg-config-check | |
| name: Check pkg-config | |
| run: | | |
| echo "pkg-config libraw --libs: $(pkg-config --libs libraw 2>/dev/null || echo 'not found')" | |
| echo "pkg-config libjpeg --libs: $(pkg-config --libs libjpeg 2>/dev/null || echo 'not found')" | |
| - id: clean-libjpeg-files | |
| name: Clean libjpeg files | |
| run: rm -rf jpeg-9d jpegsrc.v9d.tar.gz | |
| - id: clean-libraw-files | |
| name: Clean LibRaw Build Files | |
| run: rm -rf LibRaw-0.21.2 LibRaw-0.21.2.tar.gz | |
| - id: install-npm | |
| name: Install npm Packages | |
| run: npm ci | |
| - id: lint | |
| name: Lint | |
| run: npm run format-check && npm run lint | |
| - id: build-package | |
| name: Build Package | |
| run: npm run build | |
| - id: unit-tests | |
| name: Run Unit Tests | |
| run: npm run test |