From 98e12a1ee7cfe7d330d2c744f489a2606fe73be5 Mon Sep 17 00:00:00 2001
From: Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
Date: Mon, 29 May 2023 11:53:23 -0300
Subject: [PATCH] add GitHub Actions CI

---
 .github/workflows/ci.yaml | 42 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 .github/workflows/ci.yaml

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..753418c
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,42 @@
+name: "CI"
+on:
+  push:
+    branches: ["main"]
+  pull_request:
+    types:
+      - opened
+      - synchronize
+      - reopened
+      - ready_for_review
+
+concurrency:
+  group: ci-check-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  check:
+    runs-on: ubuntu-latest
+    if: github.event.pull_request.draft != true
+    strategy:
+      matrix:
+        "python-version": ["3.11"]
+    steps:
+    - uses: actions/checkout@v3
+      with:
+        submodules: true
+    - name: "Install Poetry"
+      run: "pip install poetry"
+    - name: "Setup Python"
+      uses: actions/setup-python@v4
+      with:
+        python-version: "${{ matrix.python-version }}"
+        cache: "poetry"
+    - name: "Install poetry dependencies"
+      run: "poetry install --no-interaction"
+    - run: "pip install pre-commit"
+    - uses: actions/cache@v3
+      with:
+        path: ~/.cache/pre-commit
+        key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
+    - name: "Run pre-commit"
+      run: pre-commit run --show-diff-on-failure --color=always --hook-stage push