-
Notifications
You must be signed in to change notification settings - Fork 13
37 lines (36 loc) · 1.11 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
name: "CI"
on: # yamllint disable
push:
branches:
- "main"
pull_request:
release:
types: [published]
jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- name: "CHECKOUT REPOSITORY CODE"
uses: "actions/checkout@v2"
- name: "SETUP ENVIRONMENT"
uses: "networktocode/gh-action-setup-poetry-environment@v4"
- name: "RUN YAMLLINT ON ANSIBLE PLAYBOOK"
run: "poetry run yamllint ."
- name: "RUN HADOLINT ON DOCKERFILE"
uses: "hadolint/[email protected]"
with:
dockerfile: Dockerfile
test:
runs-on: "ubuntu-latest"
steps:
- name: "CHECKOUT REPOSITORY CODE"
uses: "actions/checkout@v2"
- name: "BUILD NAUTOBOT-LAB CONTAINER"
run: "docker build -t networktocode/nautobot-lab:latest ."
- name: "START NAUTOBOT-LAB CONTAINER"
run: "docker run -itd --name nautobot networktocode/nautobot-lab:latest"
- name: "PAUSE TO ALLOW THE CONTAINER TO BOOT"
run: "sleep 30"
- name: "TEST NAUTOBOT-LAB CONTAINER"
run: "docker exec -t nautobot pytest ./templates/tests/tests.py"