-
Notifications
You must be signed in to change notification settings - Fork 96
65 lines (55 loc) · 1.87 KB
/
non-interactive-build-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
# Copyright 2024 The MathWorks, Inc.
name: Build and Test the "Non-Interactive" Dockerfile
# Trigger this workflow either manually or when a new change is pushed to the
# repo (except .md files)
on:
workflow_dispatch:
push:
# Trigger the workflow when the Dockerfile or any file under tests/ is modified
paths:
- "alternates/non-interactive/Dockerfile"
- "tests/**"
- "!tests/**.md"
schedule:
# Run at 00:00 on every Monday (1st Day of the Week)
- cron: "0 0 * * 1"
env:
IMAGE_BASE_NAME: matlab-non-interactive
ALT_PATH: alternates/non-interactive
jobs:
build-test-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
matlab-release: [r2024a, r2023b, r2023a, r2022b, r2022a, r2021b, r2021a, r2020b]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image locally
uses: docker/build-push-action@v4
with:
platforms: linux/amd64
context: ${{ env.ALT_PATH }}
load: true
build-args: |
MATLAB_RELEASE=${{ matrix.matlab-release }}
tags: |
${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Test container
working-directory: tests
env:
IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
BATCH_TOKEN: ${{ secrets.MATLAB_BATCH_TOKEN_EXPIRES_03_2025 }}
run: |
python -m unittest ${{ env.ALT_PATH }}/test_matlabbatch.py