Skip to content

Improve CI

Improve CI #12

---
name: "Single Test Simple"
on: # yamllint disable-line rule:truthy
pull_request: {}
# workflow_dispatch: {}
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
env:
NAUTOBOT_VER: "stable"
PYTHON_VER: "3.11"
jobs:
tests:
runs-on: "ubuntu-22.04"
steps:
- name: "Check Out Repository Code"
uses: "actions/checkout@v4"
- name: "Configure"
id: "config"
env:
COMPOSE_FILE: "docker-compose.base.yml"
run: |
cd development
cp creds.example.env creds.env
# Read Docker image reference from Compose configuration
IMAGE="$(docker compose convert --format json | jq -r .services.nautobot.image)"
cd -
echo "image=${IMAGE}" | tee -a "$GITHUB_OUTPUT"
- name: "Build Docker Image"
uses: "./.github/actions/build-push"
with:
add-image-reference: "${{ steps.config.outputs.image }}"
image-prefix: "ghcr.io/${{ github.repository }}/nautobot-dev"
image-tag: "pr-${{ github.event.pull_request.number }}-${{ env.NAUTOBOT_VER }}-py${{ env.PYTHON_VER }}"
nautobot-version: "${{ env.NAUTOBOT_VER }}"
password: ${{ secrets.GH_NAUTOBOT_BOT_TOKEN }}
python-version: "${{ env.PYTHON_VER }}"
username: ${{ github.actor }}
- name: "Run Linters"
uses: "./.github/actions/run-linters"
with:
nautobot-version: "${{ env.NAUTOBOT_VER }}"
python-version: "${{ env.PYTHON_VER }}"
- name: "Unit Tests with Postgres"
uses: "./.github/actions/unittests"
with:
db-backend: "postgres"
nautobot-version: "${{ env.NAUTOBOT_VER }}"
python-version: "${{ env.PYTHON_VER }}"