-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (49 loc) · 1.48 KB
/
Copy pathbuild.yml
File metadata and controls
58 lines (49 loc) · 1.48 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
name: Build
on:
push:
branches: [master, main]
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read version
id: version
run: echo "version=$(tr -d '[:space:]' < VERSION)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build the Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
load: true
tags: android-ci-github-action:test
labels: |
org.opencontainers.image.version=${{ steps.version.outputs.version }}
- name: Smoke-test deprecation warning
run: |
set +e
output=$(docker run --rm android-ci-github-action:test 'echo smoke-ok' 2>&1)
status=$?
set -e
printf '%s\n' "$output"
echo "$output" | grep -q 'android-ci-github-action deprecated'
echo "$output" | grep -q 'smoke-ok'
test "$status" -eq 0
- name: Reject empty args
run: |
set +e
docker run --rm android-ci-github-action:test ''
status=$?
set -e
test "$status" -ne 0
- name: Generate image SBOM
uses: anchore/sbom-action@v0
with:
image: android-ci-github-action:test
artifact-name: sbom-android-ci-github-action.spdx.json
format: spdx-json