Skip to content

Prompting

Prompting #560

name: "CI Skill Manager"
on:
push:
branches: [ master ]
paths:
- "skill-manager/**"
- ".github/**"
pull_request:
branches: [ master ]
paths:
- "skill-manager/**"
- ".github/**"
workflow_dispatch:
jobs:
skill-manager:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-skill-manager-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-skill-manager-
${{ runner.os }}-buildx-
- name: Build test image
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./skill-manager
target: test
load: True
push: False
tags: skill-manager:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Run test image
uses: addnab/docker-run-action@v3
with:
image: skill-manager:${{ github.sha }}
options: -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}/skill-manager/test-reports:/app/test-reports
run: |
python -m pytest --junitxml=test-reports/junit.xml --cov --cov-report=xml:test-reports/coverage.xml --cov-report=html:test-reports/coverage.html
- uses: actions/upload-artifact@v2
with:
name: skill-manager-test-reports
path: ${{ github.workspace }}/skill-manager/test-reports
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache