Ltfat.yaml (#346) #1059
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
check-package: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
# - docker.io/gnuoctave/octave | |
- ghcr.io/gnu-octave/octave | |
version: | |
- latest | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- | |
name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- | |
name: Create local package repository | |
run: | | |
bundle exec jekyll build -d test | |
- | |
name: Check for changed packages | |
run: | | |
for f in $(git --no-pager diff --name-only HEAD~1 HEAD) | |
do | |
if [ "$(dirname $f)" == "packages" ] && [ "${f##*.}" == "yaml" ] | |
then | |
name="$(basename $f)" | |
CHANGED_PACKAGES+=" ${name%.*} " | |
fi | |
done | |
if [ -n "$CHANGED_PACKAGES" ] | |
then | |
echo "Changed packages: $CHANGED_PACKAGES" | |
echo "CHANGED_PACKAGES=\"$CHANGED_PACKAGES\"" >> $GITHUB_ENV | |
else | |
echo "No packages changed." | |
fi | |
env: | |
CHANGED_PACKAGES: | |
- | |
name: Pull Octave image | |
if: ${{ env.CHANGED_PACKAGES != '' }} | |
run: docker pull ${{ matrix.image }}:${{ matrix.version }} | |
- | |
name: Octave package test | |
if: ${{ env.CHANGED_PACKAGES != '' }} | |
run: | | |
pkgs=${{ env.CHANGED_PACKAGES }} | |
for p in $pkgs | |
do | |
echo -e "\n\n## Test package '$p'\n\n" | |
docker run \ | |
--volume="$(pwd):/workdir:rw" \ | |
${{ matrix.image }}:${{ matrix.version }} \ | |
octave-cli --eval "cd /workdir/assets/ci; \ | |
octave_ci('$p', '/workdir/test/packages/index.html')" | |
done | |
check-yaml: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout repository | |
uses: actions/checkout@v3 | |
- | |
name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
# Semantic version range syntax or exact version of a Python version | |
python-version: '3.x' | |
- | |
name: Install dependencies | |
run: | | |
python -m pip install --upgrade \ | |
pip setuptools wheel yamllint | |
# FIXME: Remove first line, once the affected file and line number is | |
# visible by default. | |
- | |
name: Run yamllint | |
run: | | |
yamllint --format standard -c ./assets/ci/yamllint.yaml packages | |
yamllint -c ./assets/ci/yamllint.yaml packages |