generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 144
64 lines (59 loc) · 2.09 KB
/
static-checks.yaml
File metadata and controls
64 lines (59 loc) · 2.09 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
name: Static Checks
permissions:
contents: read
pull-requests: write
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
login-to-amazon-ecr:
name: Setup for ECR
runs-on:
- codebuild-holosoma-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
# - codebuild-holosoma-cpu-build-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-session-name: gha-${{ github.run_id }}-${{ github.run_attempt }}
- name: Setup ecr-cred helper
run: |
sudo apt update
sudo apt install -y amazon-ecr-credential-helper
mkdir -p ~/.docker
echo '{"credsStore": "ecr-login"}' > ~/.docker/config.json
run-checks:
name: Run Checks
runs-on:
- codebuild-holosoma-gpu-build-${{ github.run_id }}-${{ github.run_attempt }}
# - codebuild-holosoma-cpu-build-${{ github.run_id }}-${{ github.run_attempt }}
needs: login-to-amazon-ecr
container:
image: 982423663241.dkr.ecr.us-west-2.amazonaws.com/holosoma:latest
volumes:
- "precommit-cache:/github/home/.cache/pre-commit"
- "uv-cache:/github/home/.cache/uv"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# ref: ${{ github.event.inputs.branch || 'main' }}
fetch-depth: 5
- name: Static Checks
shell: bash
run: |
ln -s /root/.holosoma_deps "$HOME/.holosoma_deps" || true
source scripts/source_isaacgym_setup.sh
pip install pre-commit mypy
pip install -e src/holosoma
pip install -e src/holosoma_inference
git fetch origin "${GITHUB_BASE_REF:-main}"
git fetch origin "${GITHUB_SHA}"
pre-commit install-hooks
git diff --name-only "origin/${GITHUB_BASE_REF:-main}" "${GITHUB_SHA}" --
git diff --name-only "origin/${GITHUB_BASE_REF:-main}" "${GITHUB_SHA}" -- | xargs pre-commit run --files
mypy .