Merge pull request #56 from lucocozz/develop #181
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: Build Ubuntu | |
| on: | |
| push: | |
| branches: [ develop ] | |
| pull_request: | |
| branches: [ develop ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: ${{ matrix.compiler }} ${{ matrix.arch }} ${{ matrix.regex && '| regex' || ''}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build-type: [release] | |
| compiler: [gcc, clang] | |
| regex: [true, false] | |
| arch: [x64, x86] | |
| exclude: | |
| - compiler: clang | |
| arch: x86 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y meson ninja-build pkg-config ${{ matrix.compiler }} | |
| if [ "${{ matrix.arch }}" = "x86" ]; then | |
| sudo apt-get install -y gcc-multilib g++-multilib libc6-dev-i386 | |
| fi | |
| - name: Configure project | |
| run: | | |
| if [ "${{ matrix.arch }}" = "x86" ]; then | |
| meson setup .build --cross-file=cross-files/i686-linux-gnu.txt -Dregex=${{ matrix.regex }} -Dexamples=false | |
| else | |
| meson setup .build -Dregex=${{ matrix.regex }} -Dexamples=false | |
| fi | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| - name: Build project | |
| run: meson compile -C .build | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| - name: Configure examples | |
| run: | | |
| if [ "${{ matrix.arch }}" = "x86" ]; then | |
| meson configure -Dexamples=true .build | |
| else | |
| rm -rf .build/meson-info | |
| meson setup --wipe .build -Dregex=${{ matrix.regex }} -Dexamples=true | |
| fi | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| - name: Build examples | |
| run: meson compile -C .build | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| - name: Prepare Ubuntu artifacts | |
| run: | | |
| mkdir -p artifacts/lib | |
| mkdir -p artifacts/include | |
| cp .build/libargus.a artifacts/lib/ | |
| find .build -maxdepth 1 -type f -name 'libargus.so.*' -exec cp -t artifacts/lib/ {} + | |
| cp -r includes/argus artifacts/include/ | |
| cp includes/argus.h artifacts/include/ | |
| shell: bash | |
| - name: Upload Ubuntu build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: argus-ubuntu-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.regex && 'regex' || 'noregex' }} | |
| path: artifacts/ | |
| if-no-files-found: warn |