-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (91 loc) · 2.68 KB
/
qa.yml
File metadata and controls
110 lines (91 loc) · 2.68 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
name: Quality Assurance
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
packages: write
jobs:
docker-build:
name: Build Dev Container
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Calculate Dockerfile hash
id: dockerfile-hash
run: |
HASH=$(sha256sum Dockerfile | awk '{print $1}')
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "Dockerfile hash: $HASH"
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if image exists in GHCR
id: check-image
run: |
IMAGE="ghcr.io/lessui-hq/lessui-dev:${{ steps.dockerfile-hash.outputs.hash }}"
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
echo "✓ Image exists in GHCR (skipping build)"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "Image not found, will build"
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Set up QEMU
if: steps.check-image.outputs.exists == 'false'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: steps.check-image.outputs.exists == 'false'
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
if: steps.check-image.outputs.exists == 'false'
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/lessui-hq/lessui-dev:${{ steps.dockerfile-hash.outputs.hash }}
ghcr.io/lessui-hq/lessui-dev:latest
cache-from: type=gha
cache-to: type=gha,mode=max
lint:
name: Lint
needs: docker-build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Run all linting checks
run: make lint
analyze:
name: Static Analysis
needs: docker-build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Run Clang Static Analyzer
run: make analyze
test:
name: Test
needs: docker-build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Run all tests
run: make test