]> git.immae.eu Git - github/fretlink/ansible-rundeck-jobs.git/blame - .github/workflows/pr.yml
Add keys creation in rundeck
[github/fretlink/ansible-rundeck-jobs.git] / .github / workflows / pr.yml
CommitLineData
ce8b31de
GD
1name: Test PR
2on:
3 push:
4 branches:
5 - master
6 pull_request:
7 branches:
8 - master
ab34f62e
GD
9 release:
10 types: [created, edited, published]
ce8b31de
GD
11jobs:
12 tests:
13 runs-on: ubuntu-latest
14 services:
15 rundeck:
2acad55d 16 image: fretlink/rundeckforci:3.4.7-latest
ce8b31de
GD
17 ports:
18 - 4440:4440
19 env:
2acad55d 20 RUNDECK_TOKENS_FILE: /etc/tokens.properties
ce8b31de
GD
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
1371725a 29 with:
1371725a 30 path: "${{ github.repository }}"
7e22b2dd
GD
31 - name: Lint Ansible Playbook
32 uses: ansible/ansible-lint-action@master
33 with:
34 targets: "${{ github.repository }}"
8ddcfb80
IB
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
ce8b31de 39 - run: |
1371725a
GD
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
ce8b31de 44 - run: |
1371725a 45 cd ${{ github.repository }}/tests && ansible-playbook -i inventory test.yml
ab34f62e
GD
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
659481d9 53 uses: robertdebock/galaxy-action@1.1.0
ab34f62e 54 with:
fb34a60a 55 galaxy_api_key: '${{ secrets.GALAXY_API_KEY }}'