|
| 1 | +name: CI-nix |
| 2 | + |
| 3 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 4 | +# events but only for the master branch |
| 5 | +on: |
| 6 | + push: |
| 7 | + paths-ignore: |
| 8 | + - 'doc/**' |
| 9 | + pull_request: |
| 10 | + paths-ignore: |
| 11 | + - 'doc/**' |
| 12 | + |
| 13 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + os: [ubuntu-latest] |
| 21 | + compiler: [gcc, clang] |
| 22 | + |
| 23 | + fail-fast: false |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v4 |
| 28 | + # with: |
| 29 | + # submodules: recursive |
| 30 | + - name: Install dependencies |
| 31 | + if: matrix.os != 'macos-latest' |
| 32 | + run: | |
| 33 | + sudo apt-get install tcl tcl-dev |
| 34 | + |
| 35 | + # - name: Install dependencies MacOS |
| 36 | + # if: matrix.os == 'macos-latest' |
| 37 | + # run: | |
| 38 | + # sudo brew install tcl-devel |
| 39 | + |
| 40 | + - name: Pre-requirements |
| 41 | + run: | |
| 42 | + test -f ../tclconfig/tcl.m4 && echo "use ../tclconfig" || { |
| 43 | + test -f tclconfig/tcl.m4 && echo "use ./tclconfig" || \ |
| 44 | + echo 'checkout tclconfig module ...' && \ |
| 45 | + git submodule update --init --recursive tclconfig && echo "tclconfig module is up-to-date" || { |
| 46 | + echo 'checkout modules failed, clone ...' && \ |
| 47 | + git clone https://github.com/tcltk/tclconfig.git ../tclconfig |
| 48 | + } |
| 49 | + } |
| 50 | + - name: Software versions tcl/${{ matrix.compiler }} |
| 51 | + run: | |
| 52 | + echo "${{ matrix.COMPILER }}: $(${{ matrix.COMPILER }} --version)" |
| 53 | + echo "TCL: $(echo puts [info patchlevel] | tclsh)" |
| 54 | +
|
| 55 | + - name: Configure ${{ matrix.compiler }} |
| 56 | + env: |
| 57 | + CC: ${{ matrix.compiler }} |
| 58 | + run: | |
| 59 | + test -f configure && echo "configure already exists in $(pwd) ..." || autoreconf -f |
| 60 | + mkdir ./unix/build-${{ matrix.compiler }}; cd "$_" |
| 61 | + ../../configure --with-tcl=/usr/lib/tcl8.6 |
| 62 | +
|
| 63 | + - name: Build ${{ matrix.compiler }} |
| 64 | + working-directory: ./unix/build-${{ matrix.compiler }} |
| 65 | + env: |
| 66 | + CC: ${{ matrix.compiler }} |
| 67 | + run: | |
| 68 | + make -j4 |
| 69 | +
|
| 70 | + - name: Test ${{ matrix.compiler }} |
| 71 | + working-directory: ./unix/build-${{ matrix.compiler }} |
| 72 | + run: | |
| 73 | + echo $TZ; timedatectl status |
| 74 | + # tclsh ../../tests/all.tcl |
| 75 | + make test |
| 76 | +
|
| 77 | + - name: Install ${{ matrix.compiler }} |
| 78 | + working-directory: ./unix/build-${{ matrix.compiler }} |
| 79 | + run: | |
| 80 | + sudo make install |
| 81 | + echo 'if {[catch {package require tclclockmod; clock format -now}]} {puts stderr "ERROR!"; exit 1} else {puts "OK."}' | tclsh |
| 82 | +
|
| 83 | + - name: Clean ${{ matrix.compiler }} |
| 84 | + working-directory: ./unix/build-${{ matrix.compiler }} |
| 85 | + run: | |
| 86 | + make clean |
| 87 | +
|
0 commit comments