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