Skip to content

Commit

Permalink
Experiment-nightly-2 (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaffi committed Feb 14, 2023
1 parent df4931e commit 33d79f4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 17 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install python dependencies
run: make setup-development
- name: Build and Test
run: make lint-and-test
- name: Install Python dependencies, Build, and Test
run: make setup-build-test

run-integration-tests:
runs-on: ubuntu-20.04
Expand All @@ -44,14 +42,8 @@ jobs:
expected="${{ matrix.python }}"
echo $installed
[[ $installed =~ "Python ${expected}" ]] && echo "Configured Python" || (echo "Failed to configure Python" && exit 1)
- name: Start algod
run: make algod-start
- name: Install python dependencies
run: make setup-development
- name: Integration Tests Only
run: make test-integration
- name: Stop algod
run: make algod-stop
- name: Integration tests using algod
run: make algod-integration

build-docset:
runs-on: ubuntu-20.04
Expand Down
56 changes: 51 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ jobs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2

- name: Current Boston time
run: TZ='America/New_York' && export TZ && date +"%A, %B %d, %Y %I:%M:%S %p %Z"

- name: print latest_commit
run: echo ${{ github.sha }}

- id: should_run
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
run: test -z "$(git rev-list --after='24 hours' ${{ github.sha }})" && echo "::set-output name=should_run::false"

build-test:
needs: [check-date]
Expand All @@ -35,7 +39,49 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install python dependencies
run: make setup-development
- name: Build and Unit Tests
run: make lint-and-test
- name: Install Python dependencies, Build, and Test
run: make setup-build-test

run-integration-tests:
needs: [check-date]
if: ${{ github.event_name == 'release' || needs.check_date.outputs.should_run == 'true' }}

runs-on: ubuntu-20.04
strategy:
matrix:
python: ["3.10", "3.11"]
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python }}"
- name: Test Python version
run: |
installed="$(python --version)"
expected="${{ matrix.python }}"
echo $installed
[[ $installed =~ "Python ${expected}" ]] && echo "Configured Python" || (echo "Failed to configure Python" && exit 1)
- name: Integration tests using algod
run: make algod-integration

nighly-slow:
needs: [check-date]
if: ${{ github.event_name == 'release' || needs.check_date.outputs.should_run == 'true' }}

runs-on: ubuntu-20.04
strategy:
matrix:
python: ["3.10", "3.11"]
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python }}"
- name: Insert slow tests here
run: make nighly-slow
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ test-integration: integration-run

all-tests: lint-and-test test-integration

# ---- Github Actions 1-Liners ---- #

setup-build-test: setup-development lint-and-test

algod-integration: algod-start setup-development test-integration algod-stop

nightly-slow:
echo "TODO - this is a stub for a very slow test"

# ---- Local Github Actions Simulation via `act` ---- #
# assumes act is installed, e.g. via `brew install act`

Expand Down

0 comments on commit 33d79f4

Please sign in to comment.