CI testing #283
Workflow file for this run
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
name: CI testing | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
- release-candidate-* | |
tags: | |
- v* | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: Run the build with SSH debugging enabled | |
type: boolean | |
required: false | |
default: false | |
defaults: | |
run: | |
shell: bash -el {0} | |
jobs: | |
static: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./actions/setup | |
- uses: ./actions/generate-and-check | |
- uses: ./actions/run-script | |
with: | |
name: static | |
test: | |
needs: | |
- static | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
include: | |
- script: docs | |
- script: examples | |
- script: test | |
test_local_var: test local var val | |
test_args: --test-arg --test-arg | |
- script: remote | |
remote-id: 0 | |
- script: remote-test | |
coverage-name: remote-test | |
remote-id: 1 | |
- script: test-coverage | |
test_local_var: test local var val | |
test_args: --test-arg | |
coverage-name: test-coverage | |
- script: test-coverage | |
test_local_var: test local var val | |
test_args: --test-arg | |
python: "3.8" | |
runs-on: ubuntu-20.04 | |
coverage-name: test-coverage-oldest | |
- script: test-nengo | |
test_local_var: test local var val | |
test_args: --test-arg | |
python: "3.11" | |
fail-fast: false | |
runs-on: ${{ matrix.runs-on || 'ubuntu-latest' }} | |
env: | |
SCRIPT: ${{ matrix.script }} | |
TEST_GLOBAL_VAR: test global var val | |
TEST_LOCAL_VAR: ${{ matrix.test_local_var || 'this val will be overwritten' }} | |
SSH_KEY: ${{ secrets.SSH_KEY }} | |
SSH_CONFIG: ${{ secrets.SSH_CONFIG }} | |
TEST_ARGS: ${{ matrix.test_args }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
JOB_SUFFIX: ${{ matrix.remote-id }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: action-checkout | |
- uses: ./action-checkout/actions/setup | |
with: | |
path: nengo-bones | |
python-version: ${{ matrix.python || '3.9' }} | |
- uses: ./action-checkout/actions/generate-and-check | |
with: | |
path: nengo-bones | |
- uses: ./action-checkout/actions/run-script | |
with: | |
name: ${{ matrix.script }} | |
path: nengo-bones | |
- uses: actions/upload-artifact@v3 | |
if: ${{ always() && matrix.coverage-name }} | |
with: | |
name: coverage-${{ matrix.coverage-name }} | |
path: nengo-bones/.coverage | |
coverage: | |
if: ${{ always() }} | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./actions/coverage-report | |
auto-update: | |
needs: | |
- test | |
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./actions/setup | |
- uses: ./actions/generate-and-check | |
- uses: ./actions/run-script | |
with: | |
name: auto-update | |
deploy: | |
needs: | |
- test | |
if: >- | |
startsWith(github.ref_name, 'release-candidate-') || | |
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Write .pypirc to file | |
run: | | |
echo '${{ secrets.PYPIRC_FILE }}' > ~/.pypirc | |
- uses: actions/checkout@v3 | |
- uses: ./actions/setup | |
with: | |
python-version: "3.10" | |
- uses: ./actions/generate-and-check | |
- uses: ./actions/run-script | |
with: | |
name: deploy |