Nightly (GitHub runners) #767
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
# Builds the Docker from scratch and runs tests (on GitHub's runners). | |
name: Nightly (GitHub runners) | |
on: | |
schedule: | |
- cron: '0 8 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Attempts to free some disk space on the runner. | |
- name: free disk space | |
run: | | |
sudo swapoff -a | |
sudo rm -f /swapfile | |
sudo apt clean | |
# ssh-agent needs to be started so that docker build can use SSH. We use SSH | |
# when cargo is building glenside, as cargo needs to clone the private | |
# 3la-tvm repo (for the Rust TVM bindings.) | |
- name: Start ssh-agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
ssh-key: ${{ secrets.SSH_KEY }} | |
# TODO we currently have two ways of providing the SSH key: via ssh-agent + | |
# a GitHub secret, and explicitly as a build-arg flag. We should use just | |
# one method. | |
- name: Build the Docker image | |
id: build | |
run: | | |
export TAG=3la-docker:$(date +%s) | |
echo "::set-output name=TAG::$TAG" | |
DOCKER_BUILDKIT=1 docker build \ | |
. \ | |
--file Dockerfile \ | |
--ssh default \ | |
--build-arg SSH_KEY="${{ secrets.SSH_KEY }}" \ | |
--no-cache \ | |
--tag $TAG | |
- name: Run tests | |
run: docker run --env EVAL_TYPE=1 ${{ steps.build.outputs.TAG }} ./run.sh |