Skip to content

Commit

Permalink
build: update CI providers and setup (#228)
Browse files Browse the repository at this point in the history
This replaces Drone and Travis with GitHub Actions and an additional
step in the Cirrus matrix. Travis is no longer posting build statuses to
this repository and Drone lists every job as "killed" with no
explanation. GHA and Cirrus are reliable alternatives.

This commit encompasses the following changes:
- Linux x86-64 with gcc now builds on GHA (was both Travis and Drone)
- Linux ARM64 with gcc now builds on Cirrus (was Drone)
- macOS with clang now builds on GHA (was Travis) but it's important to
  note that `macos-latest` uses Apple's ARM-based processors rather than
  the legacy x86-64 Intel processors. That is, the macOS build on CI is
  `arm64-apple-darwin` rather than `x86_64-apple-darwin`.
- Linux x86-64 with clang now builds on GHA (was Travis)
- FreeBSD 12.3 is removed from CI as that version is EOL
- FreeBSD 13.1 is replaced with 13.3
- FreeBSD 13 and 14 now use release images rather than development
  snapshots. Notably, development snapshot images seem to be culled for
  versions no longer in development, which is why the 12.3 and 13.1
  builds were unable to locate the specified images.
- `tools/ci-build.sh` now attempts to determine the core count
  automatically. There is too much variability across CI providers for
  `--cores=4` to be universally appropriate; as of this writing, GHA
  uses 4 cores for Linux and 3 for macOS, and Cirrus uses 2.
- Travis and Drone badges in the README are replaced by GHA
- Linux PowerPC with clang is no longer run on CI, so it's removed from
  the list in the README
- GitHub's Dependabot is added in order to automatically keep the
  actions used up to date
  • Loading branch information
ararslan authored Aug 23, 2024
1 parent ec87958 commit fc0db22
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 87 deletions.
17 changes: 9 additions & 8 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
env:
CIRRUS_CLONE_DEPTH: 1
ARCH: amd64

task:
matrix:
- name: freebsd12-amd64
freebsd_instance:
image_family: freebsd-12-3-snap
- name: freebsd13-amd64
freebsd_instance:
image_family: freebsd-13-1-snap
image_family: freebsd-13-3
- name: freebsd14-amd64
freebsd_instance:
image_family: freebsd-14-0-snap
image_family: freebsd-14-0
- name: linux-arm64
arm_container:
image: ubuntu:latest
setup_script: |
apt-get update
apt-get install -y gcc make
script:
- cc --version
- export CFLAGS="-DITERATE=400 -DPAIRS_S=100 -DITERATIONS=24"
- ./tools/ci-build.sh --cores=$(sysctl -n hw.ncpu)
- ./tools/ci-build.sh
- make check
29 changes: 0 additions & 29 deletions .drone.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI
on:
push:
branches: [master]
tags: ["*"]
pull_request:
workflow_dispatch:
jobs:
test:
name: ${{ matrix.os }} - ${{ matrix.compiler }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
compiler:
- gcc
- clang
exclude:
- os: macos-latest
compiler: gcc
steps:
- uses: actions/checkout@v4
- run: ${{ matrix.compiler }} --version
- name: Build
run: ./tools/ci-build.sh CC=${{ matrix.compiler }}
- name: Test
run: make check
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
### Continuous Integration

| Drone | Travis | Cirrus |
| -------- | ------ | ------- |
| [![Build Status](https://cloud.drone.io/api/badges/concurrencykit/ck/status.svg)](https://cloud.drone.io/concurrencykit/ck) | [![Build Status](https://travis-ci.org/concurrencykit/ck.svg)](https://travis-ci.org/concurrencykit/ck) | [![Build Status](https://api.cirrus-ci.com/github/concurrencykit/ck.svg?branch=master)](https://cirrus-ci.com/github/concurrencykit/ck) |
| GitHub Actions | Cirrus |
| -------- | ------- |
| [![Build Status](https://github.com/concurrencykit/ck/workflows/CI/badge.svg)](https://github.com/concurrencykit/ck/actions?query=workflow%3ACI+branch%3Amaster) | [![Build Status](https://api.cirrus-ci.com/github/concurrencykit/ck.svg?branch=master)](https://cirrus-ci.com/github/concurrencykit/ck) |

Compilers tested in the past include gcc, clang, cygwin, icc, mingw32, mingw64 and suncc across all supported architectures. All new architectures are required to pass the integration test and under-go extensive code review.

Continuous integration is currently enabled for the following targets:
* `darwin/clang/x86-64`
* `darwin/clang/arm64`
* `freebsd/clang/x86-64`
* `linux/gcc/arm64`
* `linux/gcc/x86-64`
* `linux/clang/x86-64`
* `linux/clang/ppc64le`

### Compile and Build

Expand Down
32 changes: 26 additions & 6 deletions tools/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,31 @@

set -x

# Determine the number of processor cores available but favor a value specified
# as a command line argument to the script, if provided
CORES=
for arg do
# Look for `--cores=n` and set `CORES=n` if found
if [ `echo "${arg}" | cut -d'=' -f1` = "--cores" ]; then
CORES=`echo "${arg}" | cut -d'=' -f2`
fi
done
ARGS="${@}"
if [ -z "${CORES}" ]; then
# `--cores` not provided, attempt to determine it using appropriate utilities
if command -v nproc; then
# Linux and FreeBSD 13.2+
CORES=`nproc`
elif command -v sysctl; then
# macOS and BSDs
CORES=`sysctl -n hw.ncpu`
fi
if [ ! -z "${CORES}" ]; then
ARGS="${ARGS} --cores=${CORES}"
fi
fi

export CFLAGS="-DITERATE=400 -DPAIRS_S=100 -DITERATIONS=24 -DSTEPS=10000"
./configure $@
./configure ${ARGS}

if [ `uname -s` = "FreeBSD" ]; then
make -j $(sysctl -n hw.ncpu)
else
make -j
fi
make -j${CORES}

0 comments on commit fc0db22

Please sign in to comment.