Skip to content

Commit

Permalink
CI: Add fresh_run daily workflow (#1402)
Browse files Browse the repository at this point in the history
* Add default-members key to wrokspace

* Remove irrelevant targets

* Remove irrelevant targets

* Add target to run the wasm demo

* Run wasm demo in ci

* Install deps

* Fix workflow

* Fix workflow

* Build, dont run

* update readmes

* Fix syntax

* Add changelog entry

* Remove wasm-demo target

* Update README.md

* Update README.md

* Update CHANGELOG.md

* Add fresh run workflow

* Fix typo

* Add checkout

* Install pyenv

* Report on failure

* Fix

* Fix pyenv installation

* Show which target faile don report

* Add eof

* Improve report

* Fix file path

* Disable fail-fast

* Use action to install pyenv

* Fix template title

* Update CHANGELOG.md

* Activate env before running test

* Make it run daily

* Remove call to deleted target

* Revert "Make it run daily"

This reverts commit bb12ec8.

* Exclude wasm-demo

* Revert "Exclude wasm-demo"

This reverts commit 6762e6c.

* Use test file from cairo_programs

* Fix compilation in readme + workflow

* Update changelog

* Update Makefile

* Install rust

* Use self-hosted macos runner

* Add os name for prettier display

* Install rosetta in macos

* Add --agree-to-license

* Use os name in workflow name

* Free up space for ubuntu runner

* Install stuff after freeing up space

* Revert "Revert "Make it run daily""

This reverts commit 311b107.
  • Loading branch information
fmoletta authored Sep 1, 2023
1 parent 373a4fd commit a36b313
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/fresh_run_failure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: WARNING fresh_run workflow failure
labels: bug
---
Running `make {{env.FAILED_TARGET}}` failed for {{ env.OS }} system on commit {{ env.COMMIT_SHA}}
81 changes: 81 additions & 0 deletions .github/workflows/fresh_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Install dependencies, build the project and run tests from zero

on:
schedule:
# At the end of every day
- cron: "0 0 * * *"

jobs:
fresh_run:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
deps_suffix: ''
os_name: ubuntu-22.04
- os: [self-hosted, macOS]
deps_suffix: '-macos'
os_name: macos
runs-on: ${{ matrix.os_name }}
name: "Make deps, build & test on fresh ${{ matrix.os_name }} system"
steps:
# Runner runs out of disk space when running this job
# This solution was propossed on an issue in the github actions repo
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Free up space on ubuntu runner
if: matrix.os_name == 'ubuntu-22.04'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/[email protected]

- name: Install Pyenv
uses: "gabrielfalcao/pyenv-action@v13"

- name: Install Rosetta
if: matrix.os_name == 'macos'
run: softwareupdate --install-rosetta --agree-to-license

- name: Run make deps${{ matrix.deps_suffix }}
id: deps
run: make deps${{ matrix.deps_suffix }}

- name: Run make build
id: build
run: make build

- name: Run make test
id: test
run: |
. cairo-vm-env/bin/activate; \
make test
- name: Check which step failed
if: failure()
run: |
if [ ${{ steps.deps.outcome }} = failure ]; then
FAILED_TARGET=deps${{ matrix.deps_suffix }}
elif [ ${{ steps.build.outcome }} = failure ]; then
FAILED_TARGET=build
else
FAILED_TARGET=test
fi
echo "FAILED_TARGET=$FAILED_TARGET" >> $GITHUB_ENV
- name: Create Issue
if: ${{ failure() }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OS: ${{ matrix.os_name}}
COMMIT_SHA: ${{ github.sha }}
with:
filename: .github/ISSUE_TEMPLATE/fresh_run_failure.md

0 comments on commit a36b313

Please sign in to comment.