Skip to content

Commit

Permalink
modernized GitHub CI action
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Sep 12, 2024
1 parent 4519870 commit e70526b
Showing 1 changed file with 40 additions and 101 deletions.
141 changes: 40 additions & 101 deletions .github/workflows/dimbl.yml
Original file line number Diff line number Diff line change
@@ -1,136 +1,75 @@
---
name: C/C++ CI

on:
schedule:
- cron: "0 19 3 * 5" # run test once a month
push:
branches: [master]
paths:
- configure.ac
- 'src/**'
- 'include/**'
- '.github/workflows/**'
- '.github/workflows/*'

pull_request:
branches: [master]

jobs:
notification:
runs-on: ubuntu-latest
name: Notify start to IRC-gitlama
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
name: Notifications
steps:
- name: Extract Branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- name: IRC notification
uses: Gottox/irc-message-action@v2
with:
server: irc.uvt.nl
channel: '#gitlama'
nickname: GitHub
message: >
${{ github.actor }} started a build of
${{ github.event.repository.name }}
[${{ steps.extract_branch.outputs.branch }}]
- name: IRC notification of starting the builds
uses: LanguageMachines/ticcactions/irc-init@v1

build:
runs-on: ${{ matrix.os }}
needs: notification
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
compiler: [g++, clang++]
compiler: [g++-12, clang++]

steps:
- name: exclude Mac-OS with g++
shell: bash
if: ${{ matrix.os == 'macos-latest' && matrix.compiler == 'g++-12' }}
run: |
echo "action_status=skip" >> $GITHUB_ENV
echo "action_details='c++ library issues'" >> $GITHUB_ENV
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4.1.1
- name: Install Build Environment
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install pkg-config autoconf-archive
else
brew upgrade;
brew install pkg-config
brew install autoconf-archive
brew install autoconf
brew install automake
fi
- name: Install Dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libicu-dev libxml2-dev libbz2-dev
sudo apt-get install zlib1g-dev cppcheck
else
brew install libxml2;
brew install bzip2;
brew install zlib;
brew install cppcheck
fi
- name: install TiccUtils
env:
CXX: ${{ matrix.compiler }}
run: |
git clone https://github.com/LanguageMachines/ticcutils;
cd ticcutils;
bash bootstrap.sh;
./configure;
make;
sudo make install;
cd ..;

- name: install Timbl
env:
CXX: ${{ matrix.compiler }}
run: |
git clone https://github.com/LanguageMachines/timbl;
cd timbl;
bash bootstrap.sh;
./configure;
make;
sudo make install;
cd ..;
- uses: LanguageMachines/ticcactions/cpp-build-env@v1
- uses: LanguageMachines/ticcactions/cpp-dependencies@v1
- uses: LanguageMachines/ticcactions/irc-nick@v1

- name: bootstrap
run: sh bootstrap.sh
- name: configure
env:
CXX: ${{ matrix.compiler }}
run: ./configure
- name: compiler-id
id: compiler
run: |
id=$(echo ${{matrix.compiler}} | cut -d\+ -f1)
echo "id=$id" >> $GITHUB_ENV
- name: Static Code-check
run: cppcheck --enable=all --quiet --error-exitcode=0 .
- name: make
run: make
- name: install
run: sudo make install
- name: make check
env:
CXX: ${{ matrix.compiler }}
run: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib make check
continue-on-error: true
- name: show log
run: cat src/test-suite.log
- name: Notify IRC of failure
if: ${{ failure() }}
uses: Gottox/irc-message-action@v2
- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
with:
module: ticcutils

- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
with:
server: irc.uvt.nl
channel: '#gitlama'
nickname: GH-${{ runner.os }}-${{ env.id }}
message: "dimbl [${{ needs.notification.outputs.branch }}] build with ${{ matrix.compiler }} by ${{ github.actor }} on ${{ matrix.os }}: \u00034FAIL\u0003"
- name: Notify IRC of succes
if: ${{ success() }}
uses: Gottox/irc-message-action@v2
module: timbl

- uses: LanguageMachines/ticcactions/setup-cppcheck@v1
- name: Static Code-check
if: ${{ env.action_status == '' }}
run: cppcheck ${{ env.cpc_opts }} .

- uses: LanguageMachines/ticcactions/cpp-safe-build@v1

- name: Notify IRC of results
uses: LanguageMachines/ticcactions/irc-status@v1
with:
server: irc.uvt.nl
channel: '#gitlama'
nickname: GH-${{ runner.os }}-${{ env.id }}
message: "dimbl [${{ needs.notification.outputs.branch }}] build with ${{ matrix.compiler }} by ${{ github.actor }} on ${{ matrix.os }}: \u00033SUCCESS\u0003"
branch: ${{ github.ref_name }}
nickname: ${{ env.nick }}
step: test
status: ${{ env.action_status }}
details: ${{ env.action_details }}

0 comments on commit e70526b

Please sign in to comment.