Skip to content

Commit

Permalink
modernized actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Sep 14, 2024
1 parent 6da15e2 commit 82d9e75
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 89 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Delete old workflow runs
on:
schedule:
Expand Down
127 changes: 38 additions & 89 deletions .github/workflows/ticcltools.yml
Original file line number Diff line number Diff line change
@@ -1,124 +1,73 @@
---
name: C/C++ CI

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

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-14]
os: [ubuntu-latest, macos-latest]
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 libtool
brew install autoconf
brew install autoconf-archive
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
sudo apt-get install cppcheck
else
brew install libxml2
brew install bzip2
brew install zlib
brew install cppcheck
fi
- name: Configure CppCheck
run: |
if [ "$RUNNER_OS" == "Linux" ]
then
cpc_opts="--enable=warning,style --inline-suppr --force -I include -I /usr/local/include --quiet --error-exitcode=0"
else
cpc_opts="--enable=warning,style --inline-suppr --force -I include --check-level=exhaustive --quiet --error-exitcode=0"
fi
echo "cpc_opts=$cpc_opts" >> $GITHUB_ENV

- 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 ..
- uses: LanguageMachines/ticcactions/cpp-build-env@v1
- uses: LanguageMachines/ticcactions/cpp-dependencies@v1
- uses: LanguageMachines/ticcactions/irc-nick@v1

- uses: LanguageMachines/ticcactions/cpp-submodule-build@v1
with:
module: ticcutils

- name: bootstrap
run: sh bootstrap.sh
- name: configure
env:
CXX: ${{ matrix.compiler }}
run: ./configure
- uses: LanguageMachines/ticcactions/setup-cppcheck@v1
- name: Static Code-check
if: ${{ env.action_status == '' }}
run: cppcheck ${{ env.cpc_opts }} .
- name: make
run: make
- name: install
run: sudo make install
- id: compiler
run: |
cid=$(echo ${{matrix.compiler}} | cut -d\+ -f1)
echo "cid=$cid" >> $GITHUB_ENV
- name: Notify IRC of succesfull build
uses: Gottox/irc-message-action@v2

- 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.cid }}
message: "ticcltools [${{ 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 82d9e75

Please sign in to comment.