Skip to content

Commit 430628b

Browse files
committed
Testing
1 parent 440097c commit 430628b

File tree

2 files changed

+32
-161
lines changed

2 files changed

+32
-161
lines changed

.github/workflows/testing.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Testing workflow
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
deploy:
8+
uses: ./.github/workflows/update-cache-and-deployment.yaml
9+
with:
10+
update-cache: false
11+
deploy-channel: hello

.github/workflows/update-cache-and-deployment.yaml

Lines changed: 21 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -11,169 +11,29 @@ on:
1111
type: string
1212
secrets:
1313
artifact-registry-uploader-json-creds:
14-
required: true
14+
required: false
1515

1616
jobs:
17-
update-cvd-test-bazel-cache:
18-
if: inputs.update-cache
17+
testing:
1918
runs-on: ubuntu-24.04
2019
steps:
21-
- name: Free disk space
22-
uses: jlumbroso/free-disk-space@v1.3.1
23-
with:
24-
large-packages: false
25-
swap-storage: false
26-
- name: Checkout repository
27-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
28-
- name: Mount bazel cache
29-
uses: ./.github/actions/mount-bazel-cache
30-
with:
31-
action-name: run-cvd-unit-tests
32-
writable: true
33-
- name: Run cvd unit tests
34-
uses: ./.github/actions/run-cvd-unit-tests
35-
update-bazel-cache-and-deploy-debian-package-amd64:
36-
environment: deployment
37-
runs-on: ubuntu-22.04
38-
steps:
39-
- name: Free disk space
40-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # aka v1.3.1
41-
with:
42-
docker-images: false
43-
swap-storage: false
44-
- name: checkout repository
45-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
46-
- name: Mount bazel cache
47-
uses: ./.github/actions/mount-bazel-cache
48-
with:
49-
action-name: build-debian-packages
50-
writable: '${{ inputs.update-cache }}'
51-
- name: Build CF host debian packages
52-
uses: ./.github/actions/build-debian-packages
53-
with:
54-
deploy-channel: ${{ inputs.deploy-channel }}
55-
- name: Authentication on GCP project android-cuttlefish-artifacts
56-
if: inputs.deploy-channel != ''
57-
uses: 'google-github-actions/auth@v2'
58-
with:
59-
credentials_json: '${{ secrets.artifact-registry-uploader-json-creds }}'
60-
- name: Deploy CF host debian packages
61-
if: inputs.deploy-channel != ''
62-
uses: ./.github/actions/deploy-debian-packages
63-
with:
64-
deploy-channel: ${{ inputs.deploy-channel }}
65-
path: .
66-
update-bazel-cache-and-deploy-debian-package-arm64:
67-
environment: deployment
68-
runs-on: ubuntu-22.04-arm
69-
steps:
70-
- name: Free disk space
71-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # aka v1.3.1
72-
with:
73-
docker-images: false
74-
swap-storage: false
75-
- name: checkout repository
76-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
77-
- name: Mount bazel cache
78-
uses: ./.github/actions/mount-bazel-cache
79-
with:
80-
action-name: build-debian-packages
81-
writable: '${{ inputs.update-cache }}'
82-
- name: Build CF host debian packages
83-
uses: ./.github/actions/build-debian-packages
84-
with:
85-
deploy-channel: ${{ inputs.deploy-channel }}
86-
- name: Authentication on GCP project android-cuttlefish-artifacts
87-
if: inputs.deploy-channel != ''
88-
uses: 'google-github-actions/auth@v2'
89-
with:
90-
credentials_json: '${{ secrets.artifact-registry-uploader-json-creds }}'
91-
- name: Deploy CF host debian packages
92-
if: inputs.deploy-channel != ''
93-
uses: ./.github/actions/deploy-debian-packages
94-
with:
95-
deploy-channel: ${{ inputs.deploy-channel }}
96-
path: .
97-
98-
deploy-docker-image-amd64:
99-
if: inputs.deploy-channel == 'nightly'
100-
environment: deployment
101-
runs-on: ubuntu-22.04
102-
steps:
103-
- name: Checkout repository
104-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
105-
- name: Build docker image
106-
run: docker/image-builder.sh
107-
- name: Authentication on GCP project android-cuttlefish-artifacts
108-
uses: 'google-github-actions/auth@v2'
109-
with:
110-
credentials_json: '${{ secrets.artifact-registry-uploader-json-creds }}'
111-
- name: Login to Artifact Registry
112-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # aka v3.5.0
113-
with:
114-
registry: us-docker.pkg.dev
115-
username: _json_key
116-
password: '${{ secrets.artifact-registry-uploader-json-creds }}'
117-
- name: Deploy docker image
118-
uses: ./.github/actions/deploy-docker-image
119-
with:
120-
arch: amd64
121-
deploy-docker-image-arm64:
122-
if: inputs.deploy-channel == 'nightly'
123-
environment: deployment
124-
runs-on: ubuntu-22.04-arm
125-
steps:
126-
- name: Checkout repository
127-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
128-
- name: Build docker image
129-
run: docker/image-builder.sh
130-
- name: Authentication on GCP project android-cuttlefish-artifacts
131-
uses: 'google-github-actions/auth@v2'
132-
with:
133-
credentials_json: '${{ secrets.artifact-registry-uploader-json-creds }}'
134-
- name: Login to Artifact Registry
135-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # aka v3.5.0
136-
with:
137-
registry: us-docker.pkg.dev
138-
username: _json_key
139-
password: '${{ secrets.artifact-registry-uploader-json-creds }}'
140-
- name: Deploy docker image
141-
uses: ./.github/actions/deploy-docker-image
142-
with:
143-
arch: arm64
144-
deploy-docker-manifest:
145-
if: inputs.deploy-channel == 'nightly'
146-
needs: [deploy-docker-image-amd64, deploy-docker-image-arm64]
147-
environment: deployment
148-
runs-on: ubuntu-22.04
149-
steps:
150-
- name: Checkout repository
151-
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
152-
- name: Authentication on GCP project android-cuttlefish-artifacts
153-
uses: 'google-github-actions/auth@v2'
154-
with:
155-
credentials_json: '${{ secrets.artifact-registry-uploader-json-creds }}'
156-
- name: Login to Artifact Registry
157-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # aka v3.5.0
158-
with:
159-
registry: us-docker.pkg.dev
160-
username: _json_key
161-
password: '${{ secrets.artifact-registry-uploader-json-creds }}'
162-
- name: Deploy manifests
20+
- name: Testing
16321
run: |
164-
# TODO(b/440196950): Setup condition on this step when we build
165-
# stable/unstable versions here too.
166-
167-
# Stable/Unstable version tag : X.Y.Z
168-
# Nightly version tag : gitYYYYMMDD-<Github SHA 8 digit>
169-
DATE=$(date -u +'%Y%m%d')
170-
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
171-
TAG="git${DATE}-${SHORT_SHA}"
172-
IMAGE=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration
173-
174-
for MANIFEST_TAG in ${TAG} ${{ inputs.deploy-channel }}; do
175-
docker manifest create ${IMAGE}:${MANIFEST_TAG} \
176-
--amend ${IMAGE}:${TAG}-amd64 \
177-
--amend ${IMAGE}:${TAG}-arm64
178-
docker manifest push ${IMAGE}:${MANIFEST_TAG}
179-
done
22+
echo ${{ inputs.update-cache }}
23+
echo ${{ inputs.deploy-channel }}
24+
- name: Testing2
25+
if: inputs.update-cache
26+
run: |
27+
echo ${{ inputs.update-cache }}
28+
echo ${{ inputs.deploy-channel }}
29+
if [ '${{ inputs.update-cache }}' == 'true' ]; then
30+
echo hello
31+
fi
32+
- name: Testing3
33+
if: !inputs.update-cache
34+
run: |
35+
echo ${{ inputs.update-cache }}
36+
echo ${{ inputs.deploy-channel }}
37+
if [ '${{ inputs.update-cache }}' == 'true' ]; then
38+
echo hello
39+
fi

0 commit comments

Comments
 (0)