-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (46 loc) · 1.69 KB
/
code-quality.yml
File metadata and controls
58 lines (46 loc) · 1.69 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
# Runs formatting, linting, and unit tests on any push to main or a pull request.
# Useful docs:
# https://docs.astral.sh/uv/guides/integration/github/
# https://docs.astral.sh/ruff/integrations/#github-actions
name: Code quality checks
on:
pull_request:
push:
branches: ['main']
permissions:
id-token: write # for aws-actions/configure-aws-credentials
contents: read # for actions/checkout
jobs:
code-quality:
name: Code quality checks
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
enable-cache: true
version: ${{ vars.UV_VERSION }}
- name: Configure AWS Credentials
if: vars.SIDELOAD_CACHE == 'true'
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
role-to-assume: ${{ vars.AWS_OIDC_ROLE }}
aws-region: us-west-2
- name: Download cache files from S3
if: vars.SIDELOAD_CACHE == 'true'
run: |
mkdir -p .cache
echo "EPYMORPH_CACHE_PATH=$(realpath .cache)" >> $GITHUB_ENV
aws s3 sync s3://epymorph-gha-cache .cache
- name: Install dependencies
run: uv sync --frozen --all-extras --dev
- name: Check imports and formatting
run: |
uv run ruff check --no-fix --exclude doc/devlog --output-format=github .
uv run ruff format --check
- name: Check data package exports
run: uv run scripts/data_exports.py --check
- name: Run unit tests
run: uv run pytest tests/fast --vcr-mode=replay