-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.51 KB
/
pr.yml
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
52
53
name: PR
on:
pull_request:
permissions: read-all
env:
MIN_PYTHON_VERSION: "3.11"
jobs:
lint:
uses: bridgecrewio/gha-reusable-workflows/.github/workflows/pre-commit.yaml@main
with:
python-version: "3.11" # can't leverage env vars here
mypy:
uses: bridgecrewio/gha-reusable-workflows/.github/workflows/mypy.yaml@main
with:
python-version: "3.11" # can't leverage env vars here
unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
- uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4
with:
python-version: ${{ env.MIN_PYTHON_VERSION }}
cache: "pipenv"
cache-dependency-path: "Pipfile.lock"
- name: Install pipenv
run: |
python -m pip install --no-cache-dir --upgrade pipenv
- name: Install dependencies
run: |
pipenv --python ${{ env.MIN_PYTHON_VERSION }}
pipenv install --dev
- name: Test with pytest
run: |
pipenv run python -m pytest tests
docker-build:
runs-on: ubuntu-latest
env:
DH_IMAGE_NAME: bridgecrew/whorf
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Build Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
context: .
no-cache: true
tags: ${{ env.DH_IMAGE_NAME }}:latest