]> git.immae.eu Git - github/fretlink/ansible-rundeck-jobs.git/blob - .github/workflows/pr.yml
Merge pull request #20 from ismaelbouyaf/remove-undeclared-keys
[github/fretlink/ansible-rundeck-jobs.git] / .github / workflows / pr.yml
1 name: Test PR
2 on:
3 push:
4 branches:
5 - master
6 pull_request:
7 branches:
8 - master
9 release:
10 types: [created, edited, published]
11 jobs:
12 tests:
13 runs-on: ubuntu-latest
14 services:
15 rundeck:
16 image: fretlink/rundeckforci:3.4.7-latest
17 ports:
18 - 4440:4440
19 env:
20 RUNDECK_TOKENS_FILE: /etc/tokens.properties
21 options: >-
22 --health-interval=10s
23 --health-cmd="wget -t 1 -q -O /dev/null http://localhost:4440"
24 --health-timeout 5s
25 --health-retries 15
26
27 steps:
28 - uses: actions/checkout@v2
29 with:
30 path: "${{ github.repository }}"
31 - name: Lint Ansible Playbook
32 uses: ansible/ansible-lint-action@master
33 with:
34 targets: "${{ github.repository }}"
35 # override lint version due to
36 # https://github.com/ansible/ansible-lint-action/issues/59
37 override-deps: |
38 ansible-lint==5.3.2
39 - run: |
40 sudo apt update && sudo apt install -y python3-pip
41 pip3 install -r ${{ github.repository }}/requirements.txt
42 pip3 install -r ${{ github.repository }}/tests/requirements.txt
43 - run: http --ignore-stdin localhost:4440/api/26/projects name=test X-Rundeck-Auth-Token:testtoken Accept:application/json
44 - run: |
45 cd ${{ github.repository }}/tests && ansible-playbook -i inventory test.yml
46 publish:
47 runs-on: ubuntu-latest
48 needs: tests
49 if: ${{ github.event_name == 'release' }}
50 steps:
51 - uses: actions/checkout@v2
52 - name: Upload to ansible-galaxy
53 uses: robertdebock/galaxy-action@1.1.0
54 with:
55 galaxy_api_key: '${{ secrets.GALAXY_API_KEY }}'