Skip to content

library-check

library-check #401

# NOTE: This file comes from `savi-lang/base-standard-library`
#
# This workflow is responsible for running checks on pushed commits.
#
# The workflow is triggered on pull requests and pushes to the main branch.
# Pull requests are checked on a merge branch, not on the pull request branch.
# It is also triggered daily to check for regressions against the latest
# version of the Savi language and the latest versions of library dependencies.
name: library-check
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 10 * * *" # daily at 10:00 UTC
jobs:
# Run the `spec` binary for this library.
spec:
if: github.repository != 'savi-lang/base-standard-library' # skip base repo
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, shell: bash, libtensorflow: libtensorflow-cpu-linux-x86_64-2.11.0.tar.gz }
- { os: macos-latest, shell: bash, libtensorflow: libtensorflow-cpu-darwin-x86_64-2.11.0.tar.gz }
# - { os: windows-latest, shell: 'wsl-bash {0}', libtensorflow: libtensorflow-cpu-windows-x86_64-2.11.0.zip }
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@v2
- uses: savi-lang/action-install@v1
# Obtain libtensorflow dependency.
- run: curl -v -L https://storage.googleapis.com/tensorflow/libtensorflow/${{ matrix.libtensorflow }} > /tmp/libtensorflow.archive
- run: sudo ${{ runner.os == 'Windows' && 'apt-get install unzip && sudo unzip /tmp/libtensorflow.archive -d "/mnt/c/Program Files (x86)/Windows Kits/10/Testing/Development/lib/x64"' || 'tar xzvf /tmp/libtensorflow.archive -C /usr/local' }}
- if: runner.os == 'Windows'
run: sudo mv "/mnt/c/Program Files (x86)/Windows Kits/10/Testing/Development/lib/x64/lib/tensorflow.lib" "/mnt/c/Program Files (x86)/Windows Kits/10/Testing/Development/lib/x64/"
- if: runner.os == 'Linux'
run: sudo scripts/linux-patch-libtensorflow.sh /usr/local/lib/libtensorflow.so
- if: runner.os == 'Linux'
run: sudo ldconfig /usr/local/lib
- run: savi deps update --for spec
- run: savi run spec ${{ runner.os == 'Windows' && '--cross-compile=x86_64-unknown-windows-msvc' || '' }}
# Check formatting of all files in the repository.
format:
if: github.repository != 'savi-lang/base-standard-library' # skip base repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: savi-lang/action-install@v1
- run: savi format --check
##
# NOTE: The following jobs do not come from `savi-lang/base-standard-library`.
#
# Add any custom jobs you need below this comment.
# The area above this comment is reserved for future standard jobs.