Skip to content

.github/workflows: Update github actions #127

.github/workflows: Update github actions

.github/workflows: Update github actions #127

Workflow file for this run

## Copyright Notice
##
## Copyright (C) 2022-2024 CentraleSupelec
##
## Author: Julien Bect <[email protected]>
## Copying Permission Statement (STK toolbox)
##
## This file is part of
##
## STK: a Small (Matlab/Octave) Toolbox for Kriging
## (https://github.com/stk-kriging/stk/)
##
## STK is free software: you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation, either version 3 of the License, or (at your
## option) any later version.
##
## STK is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
## License for more details.
##
## You should have received a copy of the GNU General Public License
## along with STK. If not, see <http://www.gnu.org/licenses/>.
## Copying Permission Statement (this file)
##
## To the extent possible under law, Julien Bect has waived all copy-
## right and related or neighboring rights to run-tests.yml. This work
## is published from France.
##
## License: CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
name: run-tests
on: [push, pull_request]
env:
TEST_SCRIPT: >
stk_init;
stk_test ('stk_optim_testmin_box');
## The following actions are used:
## * https://github.com/actions/checkout v4
## * https://github.com/actions/upload-artifact v4
## * https://github.com/actions/download-artifact v4
## * https://github.com/matlab-actions/setup-matlab v2
## * https://github.com/matlab-actions/run-command v2
jobs:
runtests-inplace-mat:
# Apparently only Ubuntu workers support MATLAB actions for now
runs-on: ubuntu-latest
steps:
- name: Check out source repository
uses: actions/checkout@v4
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
with:
# Test in-place only on the latest version of Matlab
release: latest
- name: Run test suite
uses: matlab-actions/run-command@v2
with:
command: ${{ env.TEST_SCRIPT }}
- name: "Upload artifact: log file"
uses: actions/upload-artifact@v4
with:
name: runtests-inplace-mat-log
path: stk_runtests.log
runtests-inplace-oct:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Octave
run: |
sudo apt-get update
sudo apt-get -y install octave liboctave-dev
- name: Run test suite
run: octave --eval "${{ env.TEST_SCRIPT }}"
- name: "Upload artifact: log file"
uses: actions/upload-artifact@v4
with:
name: runtests-inplace-oct-log
path: stk_runtests.log
build-tarballs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Octave & tools
run: |
sudo apt-get update
sudo apt-get -y install octave liboctave-dev quilt markdown
- name: Install generate_html package
run: octave --eval "pkg install -forge generate_html"
- name: Build tarballs
run: make release
- name: "Upload artifacts: all-purpose release"
uses: actions/upload-artifact@v4
with:
name: allpurpose-tarball
path: build/stk-?.?.?-allpurpose.tar.gz
- name: "Upload artifacts: Octave package"
uses: actions/upload-artifact@v4
with:
name: octpkg-tarball
path: build/stk-?.?.?-octpkg.tar.gz
runtests-octpkg:
runs-on: ubuntu-latest
needs: build-tarballs
steps:
- name: Download Octave package
uses: actions/download-artifact@v4
with:
name: octpkg-tarball
- name: Get tarball name
run: |
OCTPKG_TARBALL=`ls stk-?.?.?-octpkg.tar.gz`
echo OCTPKG_TARBALL=$OCTPKG_TARBALL
echo "octpkg_tarball=$OCTPKG_TARBALL" >> $GITHUB_ENV
- name: Install Octave & tools
run: |
sudo apt-get update
sudo apt-get -y install octave liboctave-dev
- name: Install STK package
run: octave --eval "pkg install ${{ env.octpkg_tarball }}"
- name: Run test suite
run: octave --eval "pkg load stk; ${{ env.TEST_SCRIPT }}"
- name: "Upload artifact: log file"
uses: actions/upload-artifact@v4
with:
name: runtests-octpkg-log
path: stk_runtests.log
runtests-allpurpose-mat:
runs-on: ubuntu-latest
needs: build-tarballs
strategy:
matrix:
# Test some recent versions of Matlab
# (https://github.com/matlab-actions/setup-matlab/#set-up-matlab)
# [R2024b, R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
release: [R2022b, R2020b]
steps:
- name: Download allpurpose release
uses: actions/download-artifact@v4
with:
name: allpurpose-tarball
- name: Get tarball name
run: |
ALLPURPOSE_TARBALL=`ls stk-?.?.?-allpurpose.tar.gz`
echo ALLPURPOSE_TARBALL=$ALLPURPOSE_TARBALL
echo "allpurpose_tarball=$ALLPURPOSE_TARBALL" >> $GITHUB_ENV
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.release }}
- name: Unpack tarball
run: tar xzvf ${{ env.allpurpose_tarball }}
- name: Run test suite
uses: matlab-actions/run-command@v2
with:
command: cd stk; ${{ env.TEST_SCRIPT }}
- name: "Upload artifact: log file"
uses: actions/upload-artifact@v4
with:
name: runtests-allpurpose-mat-${{ matrix.release }}-log
path: stk/stk_runtests.log
runtests-allpurpose-oct:
runs-on: ubuntu-latest
needs: build-tarballs
steps:
- name: Download allpurpose release
uses: actions/download-artifact@v4
with:
name: allpurpose-tarball
- name: Get tarball name
run: |
ALLPURPOSE_TARBALL=`ls stk-?.?.?-allpurpose.tar.gz`
echo ALLPURPOSE_TARBALL=$ALLPURPOSE_TARBALL
echo "allpurpose_tarball=$ALLPURPOSE_TARBALL" >> $GITHUB_ENV
- name: Install Octave
run: |
sudo apt-get update
sudo apt-get -y install octave liboctave-dev
- name: Unpack tarball
run: tar xzvf ${{ env.allpurpose_tarball }}
- name: Run test suite
run: octave --eval "cd stk; ${{ env.TEST_SCRIPT }}"
- name: "Upload artifact: log file"
uses: actions/upload-artifact@v4
with:
name: runtests-allpurpose-oct-log
path: stk/stk_runtests.log