Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions configuration #123

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .appveyor.yml

This file was deleted.

81 changes: 1 addition & 80 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@ compile_template: &COMPILE
# ----------
# Linux

task:
<< : *ENVIRONMENT
name: linux-gcc
container:
memory: 1G
image: gcc:latest

# Base environment already includes the packages we need.

# One system with more excessive validation
compile_script:
- autoreconf -i
- ./configure CC="gcc -fsanitize=address,undefined"
- make -j4 CFLAGS="-g -O3 -Wall -Werror"

test_script:
- make check CFLAGS="-g -O3 -Wall -Werror"
- make distcheck

task:
<< : *ENVIRONMENT
name: linux-arm
Expand All @@ -48,8 +29,6 @@ task:
cpu: 2
memory: 1G

# Base environment already includes the packages we need.

# NB: we could consider building a docker image with these
# preinstalled and specifying that instead, to speed up testing.
install_script: |
Expand Down Expand Up @@ -93,70 +72,12 @@ rocky_task:

<< : *COMPILE

# ----------
# MacOS X
task:
<< : *ENVIRONMENT
name: macosx
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest

package_install_script:
- brew install autoconf automake libtool

# Try building and testing a multiarch library
compile_script:
- autoreconf -i
- ./configure CFLAGS="-g -O3 -Wall -Werror -arch arm64 -arch x86_64"
- make -j4

test_script:
- make check

# # ----------
# # Windows MINGW.
# # A work in progress which doesn't yet work. It looks slow to install
# # although *_cache can help a bit. Maybe just stick with AppVeyor.
# task:
# << : *ENVIRONMENT
# name: windows-1
# windows_container:
# image: cirrusci/windowsservercore:2019
# os_version: 2019
#
# # See https://cirrus-ci.org/guide/writing-tasks/#cache-instruction
# mingw_cache:
# # The entirety of chocholatey is heavyweight, but this is still
# # under half the time of installing mingw.
# folder: C:\Tools
#
# # default fingerprint is task name (windows-X above)
# populate_script:
# # Maybe choco install msys2 and then msys2 pacman to install
# # mingw, meaning we can archive the entire C:\tools dir?
# # - choco install -y --no-progress msys2 mingw
# # - set PATH=%PATH%;\C:\tools\msys64\usr\bin
# # - pacman -S --noconfirm --needed automake libtool autoconf
#
# # Msys is glacial, and installs its own broken compiler automatically
# # which we then replace with mingw-w64-x86_64-toolchain.
# # We a better way of downloading just the packages we need and running
# # pacman on the files directly.
# - choco install -y --no-progress msys2
# - set PATH=%PATH%;\C:\tools\msys64\usr\bin
# - pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-zlib mingw-w64-x86_64-bzip2 mingw-w64-x86_64-xz
#
# compile_script:
# - c:\tools\msys64\usr\bin\bash --login "autoreconf -i"
# - c:\tools\msys64\usr\bin\bash "./configure"
# - c:\tools\msys64\usr\bin\bash "make -j4"

# ----------
# FreeBSD
task:
name: freebsd
freebsd_instance:
image_family: freebsd-13-2
image_family: freebsd-14-0

pkginstall_script:
- pkg update -f
Expand Down
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Github's git changes NL for NL-CR on Windows.
# We pretend everything is binary so any comparisons of test files
# work.
tests/** -text
tests/*.c text
tests/*.sh text
tests/*.test text
45 changes: 45 additions & 0 deletions .github/workflows/unix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Various unix builds
name: unix CI
on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

defaults:
run:
shell: bash {0}


steps:
- name: Checkout
uses: actions/checkout@v4

# MacOS. We validate compilation of x86_64 and arm64, but only
# test arm64. This will also be using clang by default
- name: macOS specific
if: runner.os == 'macOS'
run: |
brew install autoconf automake libtool
autoreconf -i
./configure CFLAGS="-g -O3 -Wall -Werror -arch arm64 -arch x86_64"

# A slower build and test with address and undefined behaviour sanitizers
- name: Ubuntu-latest using gcc with sanitizers
if: runner.os == 'Linux'
run: |
autoreconf -i
./configure CC="gcc -fsanitize=address,undefined"

- name: Compile
run: |
make -j6

- name: Check
run: |
make check || (cat tests/test-suite.log; false)

37 changes: 37 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# A faster alternative to AppVeyor
name: Windows/MinGW-W64
on: [push, pull_request]

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up MSYS2 MinGW-W64
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: false
install: >-
zlib-devel
libbz2-devel
liblzma-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-autotools
mingw-w64-x86_64-tools-git
- name: Compile htscodecs
shell: msys2 {0}
run: |
export PATH=/mingw64/bin:$PATH
export MSYSTEM=MINGW64
autoreconf -i
./configure --disable-shared CFLAGS='-g -O3 -D_XOPEN_SOURCE=600 -Wall -Werror'
make -j8
- name: Check htscodecs
shell: msys2 {0}
run: |
export PATH=/mingw64/bin:$PATH
export MSYSTEM=MINGW64
make check || (cat tests/test-suite.log; false)