Skip to content

Build and Test on fa189d2b87a80ff6878abde5d15624fabec95b50 #36

Build and Test on fa189d2b87a80ff6878abde5d15624fabec95b50

Build and Test on fa189d2b87a80ff6878abde5d15624fabec95b50 #36

Workflow file for this run

name: Build-and-Test
run-name: Build and Test on ${{ github.sha }}
on:
push:
branches:
- master
paths:
- 'src/**'
- '!src/res/**'
- 'src/res/**/*.c'
- 'src/res/**/*.h'
- 'tests/**'
- 'Makefile'
- 'docker/*'
- 'html/**'
- '.github/workflows/build-test.yml'
pull_request:
branches:
- master
workflow_call: null
jobs:
Style-Check:
uses: ./.github/workflows/check-style.yml
with:
trigger: "${{ github.event_name }}"
permissions:
contents: write
pull-requests: write
Build-and-Test-on-Linux:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: Style-Check
strategy:
matrix:
distro:
- ubuntu
- fedora
- arch
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build
run: docker build -t clipshare -f docker/Dockerfile --build-arg "DISTRO=${{matrix.distro}}" .
- name: Test
run: docker run clipshare
Build-and-Test-on-Windows:
runs-on: windows-latest
timeout-minutes: 10
needs: Style-Check
strategy:
matrix:
target:
- arch: x86_64
env: x86_64
sys: MINGW64
- arch: x86
env: i686
sys: MINGW32
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.target.sys}}
update: false
install: >-
mingw-w64-${{matrix.target.env}}-gcc
mingw-w64-${{matrix.target.env}}-openssl
mingw-w64-${{matrix.target.env}}-libpng
mingw-w64-${{matrix.target.env}}-libunistring
make
python
findutils
diffutils
socat
sed
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build
run: |
make ARCH=${{matrix.target.arch}}
make ARCH=${{matrix.target.arch}} no_ssl
- name: Test
run: make ARCH=${{matrix.target.arch}} test
Build-and-Test-on-macOS:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
needs: Style-Check
strategy:
matrix:
os:
- macos-latest
- macos-13
steps:
- name: Install build dependencies
run: brew install openssl@3 libpng libunistring gnu-sed
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build
run: |
make
make no_ssl
- name: Install test dependencies
run: |
brew install coreutils socat
echo "$(brew --prefix coreutils)"'/libexec/gnubin' >> $GITHUB_PATH
echo "$(brew --prefix gnu-sed)"'/libexec/gnubin' >> $GITHUB_PATH
- name: Test
run: |
export TERM=xterm-256color
make test
CodeQL_Analyze:
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- Build-and-Test-on-Linux
- Build-and-Test-on-macOS
permissions:
security-events: write
steps:
- name: Install build dependencies
run: |
echo "set man-db/auto-update false" | sudo debconf-communicate && sudo dpkg-reconfigure man-db -f noninteractive
sudo apt-get update
sudo apt-get install --no-install-recommends -y apt-transport-https
sudo apt-get install --no-install-recommends -y coreutils gcc make \
libc6-dev libx11-dev libxmu-dev libxcb-randr0-dev libpng-dev libssl-dev libunistring-dev
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'c-cpp'
trap-caching: false
- name: Build using make
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"