-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (65 loc) · 2.88 KB
/
build_and_test.yml
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
name: Build, Run and Test Docker Image
on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
- name: Setup .netrc
run: |
echo "machine nexus.alfresco.com" >> ~/.netrc
echo "login ${{ secrets.NEXUS_USERNAME }}" >> ~/.netrc
echo "password ${{ secrets.NEXUS_PASSWORD }}" >> ~/.netrc
- name: Fetch artifacts from nexus
run: ${{ github.workspace }}/scripts/fetch-artifact.sh
working-directory: ${{ github.workspace }}
- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # 3.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2ad185228a349d19414702819e06df9fa4314287 # 3.4.0
- name: Login to Docker Hub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # 3.2.0
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Bake Docker images
uses: docker/bake-action@eac74531aa56a9266bfedfe5edb6b851ce2cca2b # v5.4.0
- name: Show all images
run: docker images
- name: Docker save the images produced by the bake action with the name consisting alfresco
run: |
docker save -o /tmp/alfresco-docker-images.tar $(docker images --format "{{.Repository}}:{{.Tag}}" | grep alfresco)
- name: Upload image as a tar for next job
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # 4.3.4
with:
name: ${{ github.run_number }}
path: /tmp/alfresco-docker-images.tar
compose-test:
name: compose-test ${{ matrix.docker-compose-file }}
needs: build-test
runs-on: ubuntu-latest
strategy:
matrix:
docker-compose-file: [docker-compose.yml, docker-compose-components.yml]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2ad185228a349d19414702819e06df9fa4314287 # 3.4.0
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8
with:
path: /tmp
name: "${{ github.run_number }}"
- name: Load Docker images
run: |
ls -1 /tmp/*.tar | xargs --no-run-if-empty -L 1 docker load -i
docker image ls -a
- name: Verify docker-compose
uses: Alfresco/alfresco-build-tools/.github/actions/dbp-charts/[email protected]
timeout-minutes: 10
with:
compose_pull: false
compose_file_path: docker-compose/${{ matrix.docker-compose-file }}
quay_username: ${{ secrets.QUAY_USERNAME }}
quay_password: ${{ secrets.QUAY_PASSWORD }}
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]