feat: deb package #48
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: Continuous integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v2 | |
- run: pip install --upgrade pip | |
- run: pip install black | |
- run: black --check ./**/*.py | |
test: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install deps | |
run: | | |
sudo apt-get update && sudo apt-get install -y libssl-dev swig libpcsclite1 libpcsclite-dev usbutils libsystemd-dev software-properties-common libffi-dev scdaemon | |
- name: Install protoc | |
uses: actions/setup-python@v2 | |
- run: pip install --upgrade pip poetry | |
- run: poetry install --no-interaction --no-root | |
- run: poetry run python -m grpc_tools.protoc -Iproto --python_out=yubi_bridge --grpc_python_out=yubi_bridge proto/worker/worker.proto | |
- run: sed -i 's/from worker import worker_pb2 as worker_dot_worker__pb2/from . import worker_pb2 as worker_dot_worker__pb2/g' yubi_bridge/worker/worker_pb2_grpc.py | |
- name: Run tests | |
run: poetry run pytest | |
build: | |
runs-on: self-hosted | |
needs: [lint, test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/defguard/yubi-bridge | |
tags: | | |
type=raw,value=builder | |
type=ref,event=branch | |
type=sha | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to github registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: false |