-
Notifications
You must be signed in to change notification settings - Fork 58
136 lines (127 loc) · 5.11 KB
/
ci.yml
File metadata and controls
136 lines (127 loc) · 5.11 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on: [push, pull_request]
env:
PYTHON_VERSION: "3.13"
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
precommit:
runs-on: ubuntu-latest
steps:
- name: Install Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/checkout@v4
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit virtualenv!=20.0.6
pre-commit install
- name: Run static code inspections
run: pre-commit run --all-files
django-tests:
runs-on: ubuntu-latest
steps:
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/checkout@v4
- name: Build the test container
run: |
make build_web_test
- name: Check migrations have been made
run: make check_migrations
- name: Run the django tests
run: |
make local_s3
docker compose run --rm celery_worker pytest --durations 10
forge-integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pycurl dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev
- name: Pull the algorithm-example base container
run: |
docker pull --platform=linux/amd64 \
pytorch/pytorch:2.9.1-cuda12.6-cudnn9-runtime
- name: Run the forge integration tests
run: |
cd app
uv run pytest -n 1 -m "forge_integration"
javascript-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the test container
run: |
make build_web_test
- name: Build the docs
run: |
make docs
- name: Deploy the documentation on main
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./app/docs/_build/html
deploy:
needs: [django-tests, javascript-tests]
runs-on: ubuntu-latest
permissions:
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
id-token: write
contents: read
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Build the distributable containers
# The redis cache is required for compressing the files
run: |
docker compose up -d redis
make build
- name: Configure AWS credentials for ECR
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_ROLE_ARN }}
aws-region: ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_REGION }}
- name: Push to ECR
run: |
aws ecr get-login-password --region ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_REGION }} | docker login --username AWS --password-stdin ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_HOST }}
GRAND_CHALLENGE_PRIVATE_REPOSITORY_WEB_URI=${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_WEB_URI }} make push_web_private
- name: Configure AWS credentials for ECR Public
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Push to ECR Public
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/diag-nijmegen
make push_web_base
make push_web_test_base
- name: Create Summary
run: |
echo "## Container Tag" >> $GITHUB_STEP_SUMMARY
echo "\`$(make container_tag)\`" >> $GITHUB_STEP_SUMMARY