Files
netdisco/.github/workflows/test.yml
Oliver Gorwits 209f5c4163 Update test.yml
2021-08-16 20:19:40 +01:00

47 lines
1.7 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 -l -u netdisco /home/netdisco/bin/localenv cpanm --notest Env::Path Test::Compile
- name: Run Tests
run: |
sudo -l -u netdisco /home/netdisco/bin/localenv perl ./Build.PL
sudo -l -u netdisco /home/netdisco/bin/localenv ./Build test --test_files xt/
working-directory: /github/workspace/netdisco/netdisco
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
sudo: true
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}.