-
Notifications
You must be signed in to change notification settings - Fork 10
104 lines (88 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
104 lines (88 loc) · 2.39 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI
on:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- "main"
paths-ignore:
- "**.md"
jobs:
# In reality, this will not be completely accurate as only when a Docker image is deployed to GCP
# we will truly have a deployed release. Nevertheless, this will be useful once it is deployed
# since it will help add commits to releases
release:
if: ${{ github.ref == 'refs/heads/main' }}
name: Create a Sentry release
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# This is necessary for the a release to include commits
fetch-depth: 0
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
with:
projects: "sentry-github-actions-app"
environment: production
# We have created releases from the PR, thus, the CLI gets confused finding commits
ignore_missing: true
docker-build:
name: Docker build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
docker build -t docker-app .
- name: Test starting
run: |
docker run -d --rm docker-app
docker stop $(docker ps -aq)
tests:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up
run: |
pip install tox
- name: Run tests
run: |
tox
- uses: codecov/codecov-action@v2
with:
verbose: true # optional (default = false)
pre-commit-checks:
name: Pre-commit checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up
run: |
pip install wheel
pip install pre-commit
- name: Install hooks
run: |
pre-commit install
- name: Run hooks
run: |
pre-commit run --all-files