-
Notifications
You must be signed in to change notification settings - Fork 19
62 lines (53 loc) · 1.62 KB
/
build-and-test.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
54
55
56
57
58
59
60
61
62
name: Build And Test
on:
pull_request:
branches: [ "main" ]
paths:
- .github/workflows/aws-preview.yml
- server/**
- petercat_utils/**
- subscriber/**
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
AWS_REGION: ap-northeast-1
REPORT_FILE: ./md_report.md
jobs:
build:
runs-on: ubuntu-latest
environment: production
strategy:
fail-fast: true
defaults:
run:
working-directory: ./server
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::654654285942:role/Github-OIDC
audience: sts.amazonaws.com
aws-region: ${{ env.AWS_REGION }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.0'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff
pip install pytest pytest-cov pytest-md-report
- name: Lint with Ruff
run: |
ruff check --output-format=github .
- name: Test with pytest
run: |
pytest -v --md-report --md-report-output "${{ env.REPORT_FILE }}"
- name: Render the report to the PR when tests fail
uses: marocchino/sticky-pull-request-comment@v2
with:
path: ${{ env.REPORT_FILE }}