Skip to content

Commit 3907e1b

Browse files
authored
Refresh CI to use GH actions (#156)
1 parent ed4f62b commit 3907e1b

File tree

2 files changed

+50
-61
lines changed

2 files changed

+50
-61
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,62 @@
1-
# this workflow will run ci
2-
name: ci
1+
name: CI
2+
33
on:
44
push:
55
branches:
66
- alpha
77
- beta
88
- master
9+
pull_request:
910
workflow_dispatch:
10-
env:
11-
zzzz1234: 1
11+
1212
jobs:
13-
job1:
13+
build-and-test:
1414
strategy:
15+
fail-fast: false
1516
matrix:
16-
architecture:
17-
# - arm64
18-
- x64
19-
# - x86
20-
os:
21-
- macos-latest
22-
- ubuntu-latest
23-
# - windows-latest
24-
# base - .github/workflows/ci.yml - beg
25-
env:
26-
CI_MATRIX_NAME: >
27-
${{ matrix.architecture }}
28-
${{ matrix.os }}
29-
CI_WORKFLOW_NAME: >
30-
${{ github.workflow }}
31-
- ${{ github.event_name }}
32-
- ${{ github.event.inputs.workflow_dispatch_name }}
33-
- ${{ github.ref_name }}
34-
name: >
35-
${{ matrix.architecture }}
36-
${{ matrix.os }}
17+
os: [ubuntu-24.04, macos-latest]
18+
compiler: [gcc, clang]
19+
exclude:
20+
# macOS doesn't have gcc in GitHub Actions (it's aliased to clang)
21+
- os: macos-latest
22+
compiler: gcc
23+
24+
name: ${{ matrix.os }} - ${{ matrix.compiler }}
3725
runs-on: ${{ matrix.os }}
26+
3827
steps:
39-
- run: echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
40-
# disable autocrlf in windows
41-
- run: git config --global core.autocrlf false
42-
# https://github.com/actions/checkout
43-
- uses: actions/checkout@v3
44-
# run nodejs coverages and tests
45-
- run: sh ./ci.sh
46-
# base - .github/workflows/ci.yml - end
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: recursive # if googletest is a submodule
32+
33+
- name: Install dependencies (Ubuntu)
34+
if: runner.os == 'Linux'
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y cmake build-essential
38+
39+
- name: Set compiler (GCC)
40+
if: matrix.compiler == 'gcc'
41+
run: |
42+
echo "CC=gcc" >> $GITHUB_ENV
43+
echo "CXX=g++" >> $GITHUB_ENV
44+
45+
- name: Set compiler (Clang)
46+
if: matrix.compiler == 'clang'
47+
run: |
48+
echo "CC=clang" >> $GITHUB_ENV
49+
echo "CXX=clang++" >> $GITHUB_ENV
50+
51+
- name: Configure CMake
52+
run: |
53+
cmake -B build \
54+
-DCMAKE_BUILD_TYPE=Release \
55+
-DFANN_BUILD_TESTS=ON
56+
57+
- name: Build
58+
run: cmake --build build --config Release -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)
59+
60+
- name: Run tests
61+
working-directory: build
62+
run: ./tests/fann_tests

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)