Skip to content

Commit

Permalink
Improvements to workflows for nightly run, validation, deploy.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Apr 3, 2024
1 parent e13689c commit 0e71cf4
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 21 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: "Build"
name: Build

run-name: "Build ${{ github.ref_name }}"
run-name: Build ${{ github.ref_name }}

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: "0 9 * * *"
workflow_dispatch:
workflow_call:

Expand Down Expand Up @@ -56,24 +54,16 @@ jobs:
run: make install
- name: Test
run: make test
- name: Build docs
run: make docs
- name: Check code
run: make check
- name: Validate package
run: make local
- name: Test downstream
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: make test-downstream
- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v3
with:
directory: ./build/coverage

call-validate:
name: Validate
uses: alexdlaird/pyngrok/.github/workflows/validate.yml@main
secrets: inherit
needs: build

automerge:
name: "Auto Approve"
needs: build
needs: call-validate

runs-on: ubuntu-latest

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: "Deploy"
name: Deploy

run-name: "Release ${{ github.ref_name }}"
run-name: Release ${{ github.ref_name }}

on:
release:
types: [ created ]

jobs:
call-build:
name: Build
uses: alexdlaird/pyngrok/.github/workflows/build.yml@main
secrets: inherit

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Nightly Test

on:
schedule:
- cron: "0 9 * * *"

jobs:
test:
name: Nightly Test

env:
NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
NGROK_HTTP_EDGE: ${{ secrets.NGROK_HTTP_EDGE }}
NGROK_TCP_EDGE: ${{ secrets.NGROK_TCP_EDGE }}
NGROK_API_KEY: ${{ secrets.NGROK_API_KEY }}
NGROK_HTTP_EDGE_ENDPOINT: ${{ secrets.NGROK_HTTP_EDGE_ENDPOINT }}
NGROK_TCP_EDGE_ENDPOINT: ${{ secrets.NGROK_TCP_EDGE_ENDPOINT }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Run tests
uses: nick-fields/retry@v3
with:
retry_wait_seconds: 30
max_attempts: 3
command: make install test
39 changes: 39 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Validate

on:
workflow_call:

jobs:
validate:
name: Validate

env:
NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
NGROK_HTTP_EDGE: ${{ secrets.NGROK_HTTP_EDGE }}
NGROK_TCP_EDGE: ${{ secrets.NGROK_TCP_EDGE }}
NGROK_API_KEY: ${{ secrets.NGROK_API_KEY }}
NGROK_HTTP_EDGE_ENDPOINT: ${{ secrets.NGROK_HTTP_EDGE_ENDPOINT }}
NGROK_TCP_EDGE_ENDPOINT: ${{ secrets.NGROK_TCP_EDGE_ENDPOINT }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Build test coverage
run: make install test
- name: Build docs
run: make docs
- name: Check code
run: make check
- name: Validate package
run: make local
- name: Test downstream
run: make test-downstream
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
directory: ./build/coverage

0 comments on commit 0e71cf4

Please sign in to comment.