This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (48 loc) · 1.55 KB
/
ci.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
name: CI
on:
push:
pull_request:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: list
name: List modified models
run: |
echo "modified=$(
for model in $(ls -d *-*); do
git diff --quiet HEAD~1 -- $model || echo $model
done | jq -Rsc 'split("\n")[:-1]'
)" >> $GITHUB_OUTPUT
outputs:
models: ${{ steps.list.outputs.modified }}
build-test-push:
needs: setup
runs-on: [self-hosted, gpu]
strategy:
fail-fast: false # TODO: remove
matrix:
model: ${{ fromJson(needs.setup.outputs.models) }}
env:
VERSION: '1.0.0'
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: ./build.sh $BUILDX_ARGS
working-directory: ${{ matrix.model }}
env:
# can't load/test cross-CPU-platform, hence the mess below
BUILDX_ARGS: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && '--push' || '--load' }}
BUILDX_PLATFORM: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && 'linux/arm64,linux/amd64' || 'linux/amd64' }}
TESTS_SKIP_CPU: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && '1' || '' }}