Skip to content

library-check

library-check #620

# 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 }
- { os: macos-latest, shell: bash }
- { os: windows-latest, shell: 'wsl-bash {0}' }
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@v2
- uses: savi-lang/action-install@v1
- 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.
# Run some integration tests using a binary that writes its stdin to stdout,
# and prints information about `IO.Action`s to stderr.
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: savi-lang/action-install@v1.0.0
- run: savi deps update --for integration-pipe
- run: savi build integration-pipe
- name: StdIn from simple file
run: |
bin/integration-pipe \
< spec/integration/pipe/fixtures/foo_bar.txt \
2> /tmp/stderr.txt \
| diff -u spec/integration/pipe/fixtures/foo_bar.txt -
echo 'IO.Action.Opened
IO.Action.Read
IO.Action.Closed' | diff -u - /tmp/stderr.txt
- name: StdIn from large file
run: |
bin/integration-pipe \
< spec/integration/pipe/fixtures/large.txt \
2> /tmp/stderr.txt \
| diff -u spec/integration/pipe/fixtures/large.txt -
echo 'IO.Action.Opened
IO.Action.Read
IO.Action.Read
IO.Action.Read
IO.Action.Closed' | diff -u - /tmp/stderr.txt
- name: StdIn from pipe with wait between lines
run: |
sh -c 'echo foo; sleep 0.5; echo bar' \
| bin/integration-pipe 2> /tmp/stderr.txt \
| diff -u spec/integration/pipe/fixtures/foo_bar.txt -
echo 'IO.Action.Opened
IO.Action.Read
IO.Action.Read
IO.Action.Closed' | diff -u - /tmp/stderr.txt