mbed-os/.github/workflows/docker_management.test.yml

72 lines
1.9 KiB
YAML

name: Build and test 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.
on:
pull_request:
branches: [ mbed-os-5.15 ]
paths:
- docker_images/mbed-os-env/**
- .github/workflows/docker_management.*
- requirements.txt
jobs:
build-container:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64]
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# use mbed-os-5.15 branch of blinky
-
name: Checkout
uses: actions/checkout@v3
with:
repository: ARMmbed/mbed-os-example-blinky
path: mbed-os-example-blinky
ref: mbed-os-5.15
-
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