Improve CI #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Full Tests Parallel" | |
on: # yamllint disable-line rule:truthy | |
pull_request: {} | |
# workflow_dispatch: {} | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
# linters: | |
# runs-on: "ubuntu-22.04" | |
# strategy: | |
# fail-fast: true | |
# matrix: | |
# nautobot-version: ["stable"] | |
# python-version: ["3.11"] | |
# steps: | |
# - name: "Check out repository code" | |
# uses: "actions/checkout@v4" | |
# - name: "Build" | |
# id: "build" | |
# uses: "./.github/actions/build-push" | |
# with: | |
# image-prefix: "ghcr.io/${{ github.repository }}/nautobot-dev" | |
# image-tag: "pr-${{ github.event.pull_request.number }}-py${{ matrix.python-version }}-${{ matrix.nautobot-version }}" | |
# nautobot-version: "${{ matrix.nautobot-version }}" | |
# password: ${{ secrets.GH_NAUTOBOT_BOT_TOKEN }} | |
# python-version: "${{ matrix.python-version }}" | |
# username: ${{ github.actor }} | |
# - name: "Run Linters" | |
# run: | | |
# docker run \ | |
# --rm \ | |
# --entrypoint='' \ | |
# --volume="$PWD:/source" \ | |
# --env-file=development/creds.example.env \ | |
# --env-file=development/development.env \ | |
# '${{ steps.build.outputs.image }}' \ | |
# invoke tests --lint-only --no-test-docs | |
test-postgres: | |
runs-on: "ubuntu-22.04" | |
strategy: | |
fail-fast: true | |
matrix: | |
nautobot-version: ["stable"] | |
python-version: ["3.11"] | |
# python-version: ["3.11", "3.8"] | |
# include: | |
# - nautobot-version: "2.0.0" | |
# python-version: "3.11" | |
env: | |
COMPOSE_FILE: "docker-compose.base.yml:docker-compose.postgres.yml:docker-compose.redis.yml:docker-compose.dev.yml" | |
NAUTOBOT_VER: "${{ matrix.nautobot-version }}" | |
PYTHON_VER: "${{ matrix.python-version }}" | |
steps: | |
- name: "Check out repository code" | |
uses: "actions/checkout@v4" | |
- name: "Build" | |
id: "build" | |
uses: "./.github/actions/build-push" | |
with: | |
image-prefix: "ghcr.io/${{ github.repository }}/nautobot-dev" | |
image-tag: "pr-${{ github.event.pull_request.number }}-py${{ matrix.python-version }}-${{ matrix.nautobot-version }}" | |
nautobot-version: "${{ matrix.nautobot-version }}" | |
password: ${{ secrets.GH_NAUTOBOT_BOT_TOKEN }} | |
python-version: "${{ matrix.python-version }}" | |
username: ${{ github.actor }} | |
- name: "Configure" | |
id: "config" | |
run: | | |
cd development | |
cp creds.example.env creds.env | |
COMPOSE_IMAGE="$(docker compose convert --format json | jq -r .services.nautobot.image)" | |
docker tag '${{ steps.build.outputs.image }}' "$COMPOSE_IMAGE" | |
- name: "Test with Postgres" | |
run: | | |
cd development | |
docker compose run \ | |
--rm \ | |
--entrypoint='' \ | |
-- \ | |
nautobot \ | |
invoke unittest --failfast |