forked from nautobot/nautobot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin_upstream_testing_base.yml
More file actions
51 lines (48 loc) · 1.77 KB
/
Copy pathplugin_upstream_testing_base.yml
File metadata and controls
51 lines (48 loc) · 1.77 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: "Nautobot Plugin Upstream Testing - Base"
on:
workflow_call:
inputs:
invoke_context_name:
required: true
type: string
plugin_name:
required: true
type: string
env:
PYTHON_VERSION: "3.8"
jobs:
unittest:
continue-on-error: true
strategy:
fail-fast: false
matrix:
nautobot-version: ["develop", "ltm-1.6"]
runs-on: "ubuntu-20.04"
steps:
- name: "Check out repository code"
uses: "actions/checkout@v2"
with:
ref: "${{ matrix.nautobot-version == 'develop' && 'next-2.0' || matrix.nautobot-version == 'ltm-1.6' && 'develop' || env.GITHUB_REF_NAME || 'develop' }}"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
- name: "Set up Docker Buildx"
id: "buildx"
uses: "docker/setup-buildx-action@v1"
- name: "Build"
uses: "docker/build-push-action@v2"
with:
builder: "${{ steps.buildx.outputs.name }}"
context: "./"
push: false
load: true
tags: "${{ inputs.plugin_name }}/nautobot:${{ matrix.nautobot-version }}-py${{ env.PYTHON_VERSION }}"
file: "./development/Dockerfile"
cache-from: "type=gha,scope=nautobot-${{ matrix.nautobot-version }}"
build-args: |
NAUTOBOT_VER=${{ matrix.nautobot-version }}
PYTHON_VER=${{ env.PYTHON_VERSION }}
- name: "Copy credentials"
run: "cp development/creds.example.env development/creds.env"
- name: "Run Tests"
run: "INVOKE_${{ inputs.invoke_context_name }}_NAUTOBOT_VER=${{ matrix.nautobot-version }} INVOKE_${{ inputs.invoke_context_name }}_PYTHON_VER=${{ env.PYTHON_VERSION }} poetry run invoke unittest --failfast --keepdb"