From 82d9e75eab79f9e515f0a3e52e4f434f34208cba Mon Sep 17 00:00:00 2001 From: Ko van der Sloot Date: Fri, 13 Sep 2024 16:38:53 +0200 Subject: [PATCH] modernized actions --- .github/workflows/cleanup.yml | 1 + .github/workflows/ticcltools.yml | 127 +++++++++---------------------- 2 files changed, 39 insertions(+), 89 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 99d4b40..97379a8 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -1,3 +1,4 @@ +--- name: Delete old workflow runs on: schedule: diff --git a/.github/workflows/ticcltools.yml b/.github/workflows/ticcltools.yml index ac0f640..e59d977 100644 --- a/.github/workflows/ticcltools.yml +++ b/.github/workflows/ticcltools.yml @@ -1,13 +1,18 @@ +--- 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] @@ -15,110 +20,54 @@ on: 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 }}