|
| 1 | +name: build |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + include: |
| 11 | + - { target: 'Linux-x64', os: 'ubuntu-latest', shell: 'bash' } |
| 12 | + - { target: 'Windows-x64', os: 'windows-latest', sys: 'mingw64', pkgpref: 'mingw-w64-x86_64', shell: 'msys2 {0}' } |
| 13 | + - { target: 'Windows-x86', os: 'windows-latest', sys: 'mingw32', pkgpref: 'mingw-w64-i686', shell: 'msys2 {0}' } |
| 14 | + - { target: 'MacOS', os: 'macos-latest', shell: 'bash' } |
| 15 | + |
| 16 | + runs-on: ${{matrix.os}} |
| 17 | + |
| 18 | + defaults: |
| 19 | + run: |
| 20 | + shell: ${{matrix.shell}} |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: checkout |
| 24 | + uses: actions/checkout@master |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + |
| 28 | + - name: setup-linux |
| 29 | + if: matrix.os == 'ubuntu-latest' |
| 30 | + run: | |
| 31 | + sudo apt-get install xvfb libglu1-mesa-dev freeglut3-dev mesa-common-dev |
| 32 | +
|
| 33 | + - name: setup-msys |
| 34 | + if: matrix.os == 'windows-latest' |
| 35 | + uses: msys2/setup-msys2@v2 |
| 36 | + with: |
| 37 | + msystem: ${{matrix.sys}} |
| 38 | + #update: true |
| 39 | + install: git make ${{matrix.pkgpref}}-gcc zip unzip |
| 40 | + |
| 41 | + - name: setup-macos |
| 42 | + if: matrix.os == 'macos-latest' |
| 43 | + run: | |
| 44 | +
|
| 45 | + - name: prepare-linux |
| 46 | + if: matrix.os == 'ubuntu-latest' |
| 47 | + run: | |
| 48 | + echo "LDPF_LDD_TOOL=/usr/bin/ldd" >> $GITHUB_ENV |
| 49 | +
|
| 50 | + - name: prepare-msys |
| 51 | + if: matrix.os == 'windows-latest' |
| 52 | + run: | |
| 53 | + export PATH="/${{matrix.sys}}/bin" |
| 54 | + echo "PATH=$PATH" >> $GITHUB_ENV |
| 55 | + echo "MSYSTEM=$MSYSTEM" |
| 56 | + echo "PATH=$PATH" |
| 57 | + type gcc |
| 58 | + gcc -v |
| 59 | +
|
| 60 | + - name: prepare-macos |
| 61 | + if: matrix.os == 'macos-latest' |
| 62 | + run: | |
| 63 | + echo "LDPF_LDD_TOOL=/usr/bin/otool -L" >> $GITHUB_ENV |
| 64 | +
|
| 65 | +
|
| 66 | + - name: print-env |
| 67 | + run: | |
| 68 | + set |
| 69 | +
|
| 70 | + - name: download |
| 71 | + if: matrix.os == 'windows-latest' || matrix.os == 'macos-latest' |
| 72 | + run: | |
| 73 | + make download-components |
| 74 | + |
| 75 | + - name: build |
| 76 | + run: | |
| 77 | + make -j8 |
| 78 | + |
| 79 | + - name: display-size |
| 80 | + run: | |
| 81 | + cd bin |
| 82 | + du -sh * |
| 83 | + |
| 84 | +
|
| 85 | + - name: display-dynamic-libs |
| 86 | + run: | |
| 87 | + cd bin |
| 88 | + echo "---------------------------------" |
| 89 | + export PATH=. |
| 90 | + for i in `/usr/bin/find . -type f` |
| 91 | + do echo "-- $i ---------------------------" |
| 92 | + $LDPF_LDD_TOOL $i || true |
| 93 | + done |
| 94 | + echo "---------------------------------" |
| 95 | + |
| 96 | +
|
| 97 | + - name: display-symbols |
| 98 | + run: | |
| 99 | + cd bin |
| 100 | + echo "---------------------------------" |
| 101 | + for i in `/usr/bin/find . -type f` |
| 102 | + do echo "-- $i ---------------------------" |
| 103 | + /bin/nm -Dg $i || true |
| 104 | + done |
| 105 | + echo "---------------------------------" |
| 106 | + |
| 107 | +
|
| 108 | + - name: zip |
| 109 | + run: | |
| 110 | + mkdir zip |
| 111 | + mv bin zip/LDPF-Examples-${{matrix.target}} |
| 112 | + |
| 113 | + - name: upload-artifact |
| 114 | + uses: actions/upload-artifact@v2 |
| 115 | + with: |
| 116 | + name: LDPF-Examples-${{matrix.target}} |
| 117 | + path: zip |
0 commit comments