Repository navigation
70 lines (67 loc) · 2.65 KB
/
Copy pathhacs.yaml
File metadata and controls
70 lines (67 loc) · 2.65 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
name: HACS Validation
on:
push:
pull_request:
workflow_dispatch:
env:
BUILDKIT_TLS_CA_CERT: /run/buildkit/tls/ca.pem
BUILDKIT_TLS_CLIENT_CERT: /run/buildkit/tls/client.pem
BUILDKIT_TLS_CLIENT_KEY: /run/buildkit/tls/client.key
jobs:
hacs:
name: HACS
runs-on: truenas-dte-rates-for-home-assistant-storage-8g
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha || github.sha }}
persist-credentials: false
- name: Prepare empty HACS context
run: |
: "${RUNNER_TEMP:?RUNNER_TEMP is required}"
rm -rf -- "$RUNNER_TEMP/hacs-context" "$RUNNER_TEMP/hacs-result"
mkdir -p "$RUNNER_TEMP/hacs-context"
cp .github/scripts/hacs-remote-validator.Dockerfile "$RUNNER_TEMP/hacs-context/Dockerfile"
- name: Set up isolated BuildKit
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
with:
cache-binary: false
driver: remote
endpoint: tcp://buildkit:1234
driver-opts: |
cacert=${{ env.BUILDKIT_TLS_CA_CERT }}
cert=${{ env.BUILDKIT_TLS_CLIENT_CERT }}
key=${{ env.BUILDKIT_TLS_CLIENT_KEY }}
- name: Resolve current HACS validator image
id: hacs-image
run: python3 .github/scripts/resolve-hacs-image.py
- name: Run HACS validator
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
env:
DOCKER_BUILD_RECORD_UPLOAD: "false"
HACS_GITHUB_TOKEN: ${{ github.token }}
with:
build-args: |
HACS_ACTION_IMAGE=${{ steps.hacs-image.outputs.image }}
GITHUB_ACTOR=${{ github.actor }}
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_REF=${{ github.ref }}
GITHUB_SHA=${{ github.sha }}
GITHUB_EVENT_NAME=${{ github.event_name }}
INPUT_CATEGORY=integration
INPUT_COMMENT=true
context: ${{ runner.temp }}/hacs-context
file: ${{ runner.temp }}/hacs-context/Dockerfile
no-cache: true
outputs: type=local,dest=${{ runner.temp }}/hacs-result
platforms: linux/amd64
secret-envs: hacs-token=HACS_GITHUB_TOKEN
secret-files: github-event=${{ github.event_path }}
target: result
- name: Require passing HACS result
run: |
cat "$RUNNER_TEMP/hacs-result/validator.log"
test "$(cat "$RUNNER_TEMP/hacs-result/exit-code")" = 0
- name: Remove temporary HACS files
if: always()
run: rm -rf -- "$RUNNER_TEMP/hacs-context" "$RUNNER_TEMP/hacs-result"