-
Notifications
You must be signed in to change notification settings - Fork 251
82 lines (74 loc) · 1.95 KB
/
ci.yml
File metadata and controls
82 lines (74 loc) · 1.95 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
---
name: CI
"on":
push:
branches:
- main
pull_request:
merge_group:
permissions: {}
jobs:
determine-image-tag:
name: Determine Image Tag
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
tag: ${{ steps.set-tag.outputs.tag }}
steps:
- name: Set image tag
id: set-tag
run: |
if [ -n "${{ github.event.pull_request.number }}" ]; then
TAG="pr-${{ github.event.pull_request.number }}"
echo "::notice::Using PR-based tag: $TAG"
else
# Sanitize ref_name by replacing / with -
TAG="${{ github.ref_name }}"
TAG="${TAG//\//-}"
echo "::notice::Using branch/tag-based tag: $TAG"
fi
# Validate tag format
if [[ ! "$TAG" =~ ^[a-zA-Z0-9._-]+$ ]]; then
echo "::error::Invalid image tag format: $TAG"
exit 1
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
lint:
permissions:
contents: read
uses: ./.github/workflows/lint.yml
docker:
needs: determine-image-tag
uses: ./.github/workflows/docker-build-push.yml
secrets: inherit
permissions:
contents: read
packages: write
with:
image-tag: ${{ needs.determine-image-tag.outputs.tag }}
apps: |
[
{"name": "ev-node-evm", "dockerfile": "apps/evm/Dockerfile"},
{"name": "ev-node-testapp", "dockerfile": "apps/testapp/Dockerfile"}
]
test:
permissions:
actions: read
contents: read
packages: read
uses: ./.github/workflows/test.yml
secrets: inherit
docker-tests:
needs: [determine-image-tag, docker]
uses: ./.github/workflows/docker-tests.yml
secrets: inherit
permissions:
contents: read
with:
image-tag: ${{ needs.determine-image-tag.outputs.tag }}
proto:
permissions:
contents: read
pull-requests: write
uses: ./.github/workflows/proto.yml