forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.17 KB
/
docker_management.test-PR.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
82
name: Build docker image
# This workflow is triggered when Dockerfile related or github action itself changes are made in a PR
# The workflow is quite simple - builds and test the image. Release of newer version is done only when PR is merged.
# Design doc: https://github.com/ARMmbed/mbed-os/blob/master/docs/design-documents/docker_management
on:
pull_request:
branches: [ master ]
paths:
- docker_images/mbed-os-env/**
- .github/workflows/docker_management.*
- requirements.txt
jobs:
build-container:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64, linux/arm64]
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
# for PR tests, development branch of blinky is used
-
name: Checkout
uses: actions/checkout@v3
with:
repository: ARMmbed/mbed-os-example-blinky
path: mbed-os-example-blinky
ref: development
-
name: Remove mbed-os from example-application
shell: bash
run: |
cd mbed-os-example-blinky
rm -rf mbed-os
-
name: Checkout
uses: actions/checkout@v3
with:
path: mbed-os-example-blinky/mbed-os
-
name: Build container
uses: docker/build-push-action@v2
id: docker_build_dev
with:
context: ./mbed-os-example-blinky/mbed-os
platforms: ${{ matrix.platform }}
file: ./mbed-os-example-blinky/mbed-os/docker_images/mbed-os-env/Dockerfile
load: true
tags: mbed-os-env:a_pr_test
-
name: test the container
id: test
uses: addnab/docker-run-action@v2
with:
options: -v ${{ github.workspace }}:/work -w=/work
image: mbed-os-env:a_pr_test
shell: bash
run: |
uname -m
cd mbed-os-example-blinky
# build using CLI1
mbed compile -m K64F -t GCC_ARM
# build using CLI2
mbed-tools compile -m K64F -t GCC_ARM