]>
Commit | Line | Data |
---|---|---|
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 | - run: | | |
32 | sudo apt update && sudo apt install -y python3-pip | |
33 | pip3 install -r ${{ github.repository }}/requirements.txt | |
34 | pip3 install -r ${{ github.repository }}/tests/requirements.txt | |
35 | - run: http --ignore-stdin localhost:4440/api/26/projects name=test X-Rundeck-Auth-Token:testtoken Accept:application/json | |
36 | - run: | | |
37 | cd ${{ github.repository }}/tests && ansible-playbook -i inventory test.yml | |
38 | publish: | |
39 | runs-on: ubuntu-latest | |
40 | needs: tests | |
41 | if: ${{ github.event_name == 'release' }} | |
42 | steps: | |
43 | - uses: actions/checkout@v2 | |
44 | - name: Upload to ansible-galaxy | |
45 | uses: robertdebock/galaxy-action@1.1.0 | |
46 | with: | |
47 | galaxy_api_key: '${{ secrets.GALAXY_API_KEY }}' |