update tests action new messages and logic

This commit is contained in:
Oliver Gorwits
2021-08-17 11:16:38 +01:00
parent 82247e7a7f
commit 4abefdb842
3 changed files with 14 additions and 76 deletions

View File

@@ -1,25 +0,0 @@
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.4.1
branches:
only:
- master
steps:
- checkout
- run:
name: Call GitHub Releases API
command: |
cd /home/circleci/project
TAG=$(git tag -l | grep -E '^2\.[0-9]{6}' | sort -gr | head -n1 | sed -E 's/\.[0-9]{3}$//')
if [ ! -z "$TAG" ]; then
for url in $(echo $RELEASE_INJECTION | sed "s/,/ /g"); do
curl -sL -X POST -H "Content-Type: application/json" \
-u "$ACCESS_TOKEN" \
--data "{\"tag_name\": \"$TAG\", \
\"target_commitish\": \"master\", \
\"name\": \"Netdisco $TAG\"}" \
$url
done
fi

View File

@@ -11,7 +11,7 @@ on:
- master - master
jobs: jobs:
test_netdisco: test_netdisco:
name: Test Netdisco Job name: Run Netdisco Test Suite
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: 'netdisco/netdisco:latest-do' image: 'netdisco/netdisco:latest-do'
@@ -34,33 +34,33 @@ jobs:
run: chown -R netdisco:netdisco /github/workspace/netdisco/netdisco run: chown -R netdisco:netdisco /github/workspace/netdisco/netdisco
- name: Install Perl deps - name: Install Perl deps
run: sudo -u netdisco /home/netdisco/bin/localenv cpanm --notest Env::Path Test::Compile run: sudo -u netdisco /home/netdisco/bin/localenv cpanm --notest Env::Path Test::Compile
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
sudo: true
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: Run Tests - name: Run Tests
id: build_and_run_tests
run: | run: |
sudo -u netdisco /home/netdisco/bin/localenv perl ./Build.PL sudo -u netdisco /home/netdisco/bin/localenv perl ./Build.PL
sudo -u netdisco /home/netdisco/bin/localenv ./Build test --test_files xt/ sudo -u netdisco /home/netdisco/bin/localenv ./Build test --test_files xt/
working-directory: /github/workspace/netdisco/netdisco working-directory: /github/workspace/netdisco/netdisco
continue-on-error: true
- name: IRC failure notification - name: IRC failure notification
uses: Gottox/irc-message-action@v2 uses: Gottox/irc-message-action@v2
if: ${{ always() && failure() }} if: (! github.event.inputs.debug_enabled) && (steps.build_and_run_tests.outcome == 'failure')
with: with:
channel: '#netdisco' channel: '#netdisco'
nickname: github-actions nickname: github-actions
message: |- message: |-
😭 ${{ github.actor }} pushed to ${{ steps.get_tag.outputs.TAGVALUE }} on repo:${{ github.repository }} but the TESTS FAILED! 🤖 ${{ github.actor }} pushed to ${{ steps.get_tag.outputs.TAGVALUE }}: https://github.com/netdisco/netdisco/commit/${{ github.sha }}
😭 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} 😭 TESTS have FAILED! 👀 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
😭 https://github.com/netdisco/netdisco/commit/${{ github.sha }}
- name: IRC success notification - name: IRC success notification
uses: Gottox/irc-message-action@v2 uses: Gottox/irc-message-action@v2
if: ${{ always() && success() }} if: (! github.event.inputs.debug_enabled) && (steps.build_and_run_tests.outcome == 'success')
with: with:
channel: '#netdisco' channel: '#netdisco'
nickname: github-actions nickname: github-actions
message: |- message: |-
🎉 ${{ github.actor }} pushed to ${{ steps.get_tag.outputs.TAGVALUE }} on repo:${{ github.repository }} and the TESTS PASSED! 🤖 ${{ github.actor }} pushed to ${{ steps.get_tag.outputs.TAGVALUE }}: https://github.com/netdisco/netdisco/commit/${{ github.sha }} (tests PASSED)
🎉 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - name: Setup tmate session
🎉 https://github.com/netdisco/netdisco/commit/${{ github.sha }} uses: mxschmitt/action-tmate@v3
if: always() && github.event.inputs.debug_enabled && (github.event_name == 'workflow_dispatch')
with:
sudo: true

View File

@@ -1,37 +0,0 @@
language: perl
perl:
- "5.30"
- "5.10"
os: linux
dist: trusty
addons:
apt:
packages:
- libsnmp-dev
- phantomjs
- graphviz
hosts:
- localhost
branches:
only:
- /^2\.\d{6}$/
- 'master'
- /.*travis.*/
install:
- cpanm --quiet --notest https://github.com/egiles/test-compile/archive/v2.1.2.tar.gz PkgConfig Test::CChecker Alien::zlib::Static Alien::OpenSSL::Static Alien::SNMP
script: |
perl Build.PL && \
./Build && \
PERL_MM_USE_DEFAULT=1 ./Build installdeps --cpan_client 'cpanm --quiet --notest' && \
ND_PHANTOMJS=/usr/bin/phantomjs ./Build test --test_files xt/
notifications:
irc:
on_success: always
on_failure: always
channels:
- 'irc.libera.chat#netdisco'
# email:
# on_success: always
# on_failure: always
# recipients:
# - 'netdisco-ng-commit@lists.sourceforge.net'