-
Notifications
You must be signed in to change notification settings - Fork 12
98 lines (82 loc) · 3.1 KB
/
build.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Check that ibek-support support modules will build in a container
on:
push:
pull_request:
jobs:
check-generate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Run schema/ioc instance generation tests
run: |
pip install -r requirements.txt
bash tests/test_generate.sh
check-docker-build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
max-parallel: 10
matrix:
repo: [ioc-adaravis, ioc-pmac, ioc-lakeshore340, ioc-tetramm, ioc-opcua, ioc-motorSim, ioc-adsimdetector]
include:
# rtems is cross compiled on ubuntu-latest
# linux is natively compiled on ubuntu-latest and macos-latest
# enable below for RTEMS
# - architecture: rtems
# os: ubuntu-latest
# platform: linux/amd64
- os: ubuntu-latest
epics-target: linux-x86_64
extension: ""
platform: linux/amd64
# enable below for MACOS native build on M1 macs
# M1 Macs are coming!: https://github.com/github/roadmap/issues/528
# - architecture: linux
# os: macos-latest-x1
# platform: linux/arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
uses: docker-practice/actions-setup-docker@fd7ecdac7caf8e2c541a48c9bcc280aae59a8461
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup
# before building the container set up to use this version of ibek-support
# and its associated version of ibek
env:
REPO: ${{ matrix.repo }}
run: |
git clone https://github.com/epics-containers/${REPO} /tmp/generic_ioc
cp -r . /tmp/generic_ioc/ibek-support
cp ./requirements.txt /tmp/generic_ioc
- name: Build image
uses: docker/build-push-action@v5
with:
context: /tmp/generic_ioc
platforms: ${{ matrix.platform }}
target: runtime
build-args: |
IMAGE_EXT=${{ matrix.extension }}
cache-from: type=gha,scope=${{ matrix.epics-target }}
cache-to: type=gha,mode=max,scope=${{ matrix.epics-target }}
tags: ci_test
load: true
- name: Test image
# can't test non native without some hardware to run on
if: ${{ matrix.epics-target == 'linux-x86_64' }}
run: /tmp/generic_ioc/tests/run-tests.sh ci_test