Skip to content

Commit c717cea

Browse files
Merge pull request #4 from marckleinebudde/ci
github-actions: add
2 parents 6740b52 + 20328b9 commit c717cea

File tree

2 files changed

+181
-0
lines changed

2 files changed

+181
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '29 21 * * 1'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'cpp' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v3
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3

.github/workflows/compile.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: native and cross
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-24.04
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
release:
12+
- "ubuntu:20.04"
13+
- "ubuntu:22.04"
14+
- "ubuntu:24.04"
15+
- "ubuntu:rolling"
16+
- "debian:oldstable-slim"
17+
- "debian:stable-slim"
18+
- "debian:testing-slim"
19+
- "debian:unstable-slim"
20+
- "debian:experimental"
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Prepare ${{ matrix.release }} container
26+
env:
27+
release: ${{ matrix.release == 'debian:experimental' && '-t experimental' || '' }}
28+
run: |
29+
podman version
30+
podman run --name stable -di --userns=keep-id:uid=1000,gid=1000 -v "$PWD":/home -w /home ${{ matrix.release }} bash
31+
podman exec -i stable uname -a
32+
podman exec -i stable id
33+
podman exec -i -u root stable apt update
34+
podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt install -o APT::Install-Suggests=false -qy ${release} \
35+
automake \
36+
clang \
37+
gcc \
38+
gcc-aarch64-linux-gnu \
39+
gcc-arm-linux-gnueabihf \
40+
gcc-mips-linux-gnu \
41+
intltool \
42+
libtool \
43+
make \
44+
sed
45+
46+
- name: autogen
47+
run: |
48+
podman exec -i stable ./autogen.sh
49+
50+
- name: Configure & Build with gcc
51+
env:
52+
CC: gcc
53+
run: |
54+
podman exec -i stable bash -c "mkdir build-${CC} && cd build-${CC} && ../configure"
55+
podman exec -i stable make -C build-${CC}
56+
57+
- name: Configure & Build with clang
58+
env:
59+
CC: clang
60+
run: |
61+
podman exec -i stable bash -c "mkdir build-${CC} && cd build-${CC} && ../configure"
62+
podman exec -i stable make -C build-${CC}
63+
64+
- name: Configure & Build with arm-linux-gnueabihf-gcc
65+
env:
66+
host: arm-linux-gnueabihf
67+
run: |
68+
podman exec -i stable bash -c "mkdir build-${host} && cd build-${host} && ../configure --host=${host}"
69+
podman exec -i stable make -C build-${host}
70+
71+
- name: Configure & Build with arm-linux-gnueabihf-clang
72+
if:
73+
${{ matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim' }}
74+
env:
75+
host: arm-linux-gnueabihf
76+
run: |
77+
podman exec -i stable bash -c "mkdir build-${host}-clang && cd build-${host}-clang && ../configure --host=${host} CC=\"clang --target=${host}\""
78+
podman exec -i stable make -C build-${host}-clang
79+
80+
- name: Configure & Build with aarch64-linux-gnu
81+
env:
82+
host: aarch64-linux-gnu
83+
run: |
84+
podman exec -i stable bash -c "mkdir build-${host} && cd build-${host} && ../configure --host=${host}"
85+
podman exec -i stable make -C build-${host}
86+
87+
- name: Configure & Build with aarch64-linux-gnu-clang
88+
if:
89+
${{ matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim' }}
90+
env:
91+
host: aarch64-linux-gnu
92+
run: |
93+
podman exec -i stable bash -c "mkdir build-${host}-clang && cd build-${host}-clang && ../configure --host=${host} CC=\"clang --target=${host}\""
94+
podman exec -i stable make -C build-${host}-clang
95+
96+
- name: Configure & Build with mips-linux-gnu
97+
env:
98+
host: mips-linux-gnu
99+
run: |
100+
podman exec -i stable bash -c "mkdir build-${host} && cd build-${host} && ../configure --host=${host}"
101+
podman exec -i stable make -C build-${host}
102+
103+
- name: Show logs
104+
if: ${{ failure() }}
105+
run: |
106+
for log in build-*/config.log; do \
107+
if [ -e ${log} ]; then \
108+
echo "---------------- ${log} ----------------"; \
109+
cat ${log}; \
110+
fi; \
111+
done

0 commit comments

Comments
 (0)