54 lines
2.0 KiB
YAML
54 lines
2.0 KiB
YAML
name: Test Netdisco
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
debug_enabled:
|
|
description: 'Run debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
|
|
required: false
|
|
default: false
|
|
# push:
|
|
# branches:
|
|
# - master
|
|
jobs:
|
|
test_netdisco:
|
|
name: Test Netdisco Job
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: 'netdisco/netdisco:latest-do'
|
|
options: '--user root --entrypoint /bin/ash'
|
|
volumes:
|
|
- '/home/runner/work:/github/workspace'
|
|
steps:
|
|
- name: Get the Tag
|
|
id: get_tag
|
|
run: echo ::set-output name=TAGVALUE::${GITHUB_REF#refs/tags/}
|
|
- name: Install packages
|
|
run: apk add openssh xz tmux bash curl sudo gcc make
|
|
- name: Install fake apt-get
|
|
run: echo 'if [ "$1" == "update" ]; then exec apk update; else exec apk add openssh xz; fi' > /usr/local/bin/apt-get && chmod +x /usr/local/bin/apt-get
|
|
- name: Add localhost
|
|
run: echo "127.0.0.1 localhost" >> /etc/hosts
|
|
- name: Check out latest code
|
|
uses: actions/checkout@v1
|
|
- name: Fix owner of checkout
|
|
run: chown -R netdisco:netdisco /github/workspace/netdisco/netdisco
|
|
- name: Install Perl deps
|
|
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
|
|
run: |
|
|
sudo -u netdisco /home/netdisco/bin/localenv perl ./Build.PL
|
|
sudo -u netdisco /home/netdisco/bin/localenv ./Build test --test_files xt/
|
|
working-directory: /github/workspace/netdisco/netdisco
|
|
- name: IRC notification
|
|
uses: Gottox/irc-message-action@v2
|
|
with:
|
|
channel: '#netdisco'
|
|
nickname: netdisco-automation
|
|
message: |-
|
|
${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }}
|