-
Notifications
You must be signed in to change notification settings - Fork 43
149 lines (143 loc) · 4.57 KB
/
build.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build
on: [ push, pull_request ]
jobs:
dist:
name: Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install libtool v2.4.7
run: |
wget -q https://ftpmirror.gnu.org/libtool/libtool-2.4.7.tar.gz
tar xvfz libtool-2.4.7.tar.gz
cd libtool-2.4.7
./configure
make
sudo make install
- name: Configure
run: |
./bootstrap.sh
./configure
- name: Make source package
run: make VERSION=${{ github.sha }} dist
- name: Upload source package artifact
uses: actions/upload-artifact@v3
with:
name: bzip3-${{ github.sha }}
path: bzip3-${{ github.sha }}.tar.gz
- name: Run distcheck
run: make distcheck
build:
name: Build Matrix
needs: [ dist ]
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest ]
compiler: [ clang, gcc ]
feature: [ with-pthread, without-pthread ]
runs-on: ${{ matrix.platform }}
steps:
- name: Download source package artifact
uses: actions/download-artifact@v3
with:
name: bzip3-${{ github.sha }}
- name: Extract source package
run: tar --strip-components=1 -xf bzip3-${{ github.sha}}.tar.gz
- name: Fetch examples
run: |
mkdir examples
cd examples
wget https://github.com/kspalaiologos/bzip3/raw/${{ github.sha }}/examples/shakespeare.txt \
https://github.com/kspalaiologos/bzip3/raw/${{ github.sha }}/examples/shakespeare.txt.bz3
- name: Configure
run: ./configure CC=${{ matrix.compiler }} --${{ matrix.feature }}
- name: Make
run: make
- name: Check
run: make roundtrip test
build-archs:
name: Build Matrix for non-x86 architectures (Debian Stretch)
needs: [ dist ]
strategy:
fail-fast: false
matrix:
compiler: [ clang, gcc ]
feature: [ with-pthread, without-pthread ]
arch: [ armv6, armv7, aarch64, s390x, ppc64le ]
runs-on: ubuntu-latest
steps:
- name: Download source package artifact
uses: actions/download-artifact@v3
with:
name: bzip3-${{ github.sha }}
- name: Extract source package
run: tar --strip-components=1 -xf bzip3-${{ github.sha}}.tar.gz
- name: Fetch examples
run: |
mkdir examples
cd examples
wget https://github.com/kspalaiologos/bzip3/raw/${{ github.sha }}/examples/shakespeare.txt \
https://github.com/kspalaiologos/bzip3/raw/${{ github.sha }}/examples/shakespeare.txt.bz3
- uses: uraimo/run-on-arch-action@v2
name: Run in the container
with:
arch: ${{ matrix.arch }}
distro: bullseye
shell: /bin/sh
dockerRunArgs: |
--volume "${PWD}:/bzip3"
install: |
apt update -q -y
apt install -q -y clang gcc make
run: |
cd /bzip3
./configure CC=${{ matrix.compiler }} --${{ matrix.feature }} --disable-arch-native --disable-link-time-optimization
make && make roundtrip test
build-archs-ubuntu:
name: Build Matrix for non-x86 architectures (Ubuntu Latest)
needs: [ dist ]
strategy:
fail-fast: false
matrix:
compiler: [ clang, gcc ]
feature: [ with-pthread, without-pthread ]
arch: [ riscv64 ]
runs-on: ubuntu-latest
steps:
- name: Download source package artifact
uses: actions/download-artifact@v3
with:
name: bzip3-${{ github.sha }}
- name: Extract source package
run: tar --strip-components=1 -xf bzip3-${{ github.sha}}.tar.gz
- name: Fetch examples
run: |
mkdir examples
cd examples
wget https://github.com/kspalaiologos/bzip3/raw/${{ github.sha }}/examples/shakespeare.txt \
https://github.com/kspalaiologos/bzip3/raw/${{ github.sha }}/examples/shakespeare.txt.bz3
- uses: uraimo/run-on-arch-action@v2
name: Run in the container
with:
arch: ${{ matrix.arch }}
distro: ubuntu_latest
shell: /bin/sh
dockerRunArgs: |
--volume "${PWD}:/bzip3"
install: |
apt update -q -y
apt install -q -y clang gcc make
run: |
cd /bzip3
./configure CC=${{ matrix.compiler }} --${{ matrix.feature }} --disable-arch-native --disable-link-time-optimization
make && make roundtrip test
cmake:
name: Build with CMake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: CMake
run: cmake -B build
- name: Make
run: make -C build