-
Notifications
You must be signed in to change notification settings - Fork 338
82 lines (79 loc) · 2.53 KB
/
linux-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
on: pull_request
name: Linux Build
jobs:
# 32-bit, clang
build32:
runs-on: ubuntu-20.04
env:
CFLAGS: -m32
CC: clang
PKG_CONFIG_PATH: /opt/libjim32/lib/pkgconfig
steps:
- name: Install required packages (apt-get)
run: |
sudo apt-get update
sudo apt-get install clang gcc-multilib
- name: Get 32-bit JIM TCL from cache
id: cache-libjim32
uses: actions/cache@v4
with:
path: /opt/libjim32
key: libjim32
- if: ${{ steps.cache-libjim32.outputs.cache-hit != 'true' }}
name: Checkout JIM TCL
uses: actions/checkout@v4
with:
repository: msteveb/jimtcl
ref: 0.83
path: jimtcl
- if: ${{ steps.cache-libjim32.outputs.cache-hit != 'true' }}
name: Build 32-bit JIM TCL from source
run: |
cd jimtcl
./configure --prefix=/opt/libjim32 --with-ext=json --minimal --disable-ssl
make -j`nproc`
make install
- name: Checkout Code
uses: actions/checkout@v4
- run: ./bootstrap
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --disable-target64
- run: make -j`nproc`
- run: file src/openocd | grep 32-bit
- run: src/openocd --version
# 64-bit, gcc
build64:
runs-on: ubuntu-latest
env:
CFLAGS: -m64
CC: gcc
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Configure environment
run: |
TAG=$(git rev-parse --short HEAD)
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "NAME=openocd64-$TAG" >> $GITHUB_ENV
- name: Install required packages (apt-get)
run: |
sudo apt-get update
sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev libjim-dev
- run: ./bootstrap
- run: ./configure --enable-remote-bitbang --enable-jtag_vpi --enable-ftdi-cjtag --prefix /tmp/${{ env.NAME }}
- run: make -j`nproc`
- name: Check that we built something
run: |
file src/openocd | grep 64-bit
src/openocd --version
- name: Package
# Package into tgz so that github stores a compressed artifact, even
# though it zips that artifact again before it sends it back to be
# downloaded.
run: |
make install
tar zcvf ${{ env.NAME }}.tgz -C /tmp ${{ env.NAME }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.NAME }}
path: ${{ env.NAME }}.tgz