name: Run mock API server on: workflow_dispatch: push: branches: - MON-** jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Use Node.js uses: actions/setup-node@v2 with: node-version: "14.x" - name: Install Mockoon CLI run: npm install -D @mockoon/cli - name: Install perl dependencies uses: perl-actions/install-with-cpm@stable with: install: | DateTime Digest::MD5 Encode HTTP::ProxyPAC IO::Socket::SSL JSON::XS LWP::Protocol::https LWP::UserAgent MIME::Base64 Paws POSIX Storable URI URI::Encode - name: Run Mockoon CLI run: npx mockoon-cli start --data tests/resources/mockoon/cloud-aws-cloudtrail.json --port 3000 - name: Run plugin run: | sudo chmod -R +x tests/functional/ sudo mkdir -p /var/lib/centreon/centplugins/ sudo chmod 777 /var/lib/centreon/centplugins/ TESTS="$(tests/functional/cloud/aws/cloudtrail/checktrailstatus.sh)" echo "tests=$(echo $TESTS)" >> $GITHUB_OUTPUT if [[ $TESTS = "OK:"* ]]; then echo "OK" else echo $TESTS exit 1 fi TESTS="$(tests/functional/cloud/aws/cloudtrail/countevents.sh)" echo "tests=$(echo $TESTS)" >> $GITHUB_OUTPUT if [[ $TESTS = "OK:"* ]]; then echo "OK" else echo $TESTS exit 1 fi shell: bash