diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 57c20df6..e1d80484 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -1,14 +1,12 @@ -name: 'PyCyphal application builder' - -# Builds OpenCyphal PyCyphal release +name: 'Build PyCyphal' on: push: - branches: - - master - - issue-259 - pull_request: - branches: - - master + tags: [ '#release' ] + workflow_run: + workflows: [ 'Test PyCyphal' ] + branches: [ master ] + types: [ completed ] + # Ensures that only one workflow is running at a time concurrency: @@ -16,95 +14,25 @@ concurrency: cancel-in-progress: true jobs: - # - # PyCyphal test - # - pycyphal-test: - name: Test PyCyphal - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-2019-npcap] - python: ['3.7', '3.8', '3.9', '3.10'] - runs-on: ${{ matrix.os }} - steps: - # Checkout pycyphal repository - - name: Check out - uses: actions/checkout@v3 - - # Install Python version needed for test - - name: Install Python3 - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - # Log Python version - - name: Log Python version - run: python --version - - # Install test dependencies - - name: Install dependencies - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - sudo apt-get install -y linux-*-extra-$(uname -r) graphviz ncat - fi - git submodule update --init --recursive - python -m pip install --upgrade pip setuptools nox - shell: bash - - # Log system and network configurations - - name: Collect Linux diagnostic data - if: ${{ runner.os == 'Linux' }} - run: ip link show - - - name: Collect Windows diagnostic data - if: ${{ runner.os == 'Windows' }} - run: | - systeminfo - route print - ipconfig /all - - # Run build and test suite - - name: Run build and test - run: | - nox --non-interactive --error-on-missing-interpreters --session test pristine --python ${{ matrix.python }} - nox --non-interactive --session demo check_style docs - - # Save logs - - name: Save logs - uses: actions/upload-artifact@v3 - with: - name: PyCyphal-${{ matrix.os }}-python-${{ matrix.python }} - path: .nox/*/*/*.log - retention-days: 7 - - # - # Create release - # pycyphal-release: name: Release PyCyphal - if: (github.event_name == 'push') && (github.ref == 'refs/heads/master') - needs: pycyphal-test runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - # Checkout code from GitHub - name: Check out uses: actions/checkout@v3 - # Build distribution from source - name: Install dependencies run: | git submodule update --init --recursive python -m pip install --upgrade pip setuptools wheel twine python setup.py sdist bdist_wheel - # Obtain release version number - name: Get release version run: | cd pycyphal echo "pycyphal_version=$(python -c 'from _version import __version__; print(__version__)')" >> $GITHUB_ENV - # Upload distribution to pypi.org - name: Upload distribution run: | python -m twine upload dist/* @@ -112,7 +40,6 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_PYCYPHAL }} - # Tag release - name: Push version tag uses: mathieudutour/github-tag-action@v6.1 with: diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml new file mode 100644 index 00000000..e22b6ae5 --- /dev/null +++ b/.github/workflows/test-release.yml @@ -0,0 +1,66 @@ +name: 'Test PyCyphal' + +# Test OpenCyphal PyCyphal release +on: push +# pull_request: +# branches: +# - master + +# Ensures that only one workflow is running at a time +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + pycyphal-test: + name: Test PyCyphal + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-2019-npcap] + python: ['3.7', '3.8', '3.9', '3.10'] + runs-on: ${{ matrix.os }} + steps: + - name: Check out + uses: actions/checkout@v3 + + - name: Install Python3 + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Log Python version + run: python --version + + - name: Install dependencies + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + sudo apt-get install -y linux-*-extra-$(uname -r) graphviz ncat + fi + git submodule update --init --recursive + python -m pip install --upgrade pip setuptools nox + shell: bash + + - name: Collect Linux diagnostic data + if: ${{ runner.os == 'Linux' }} + run: ip link show + + - name: Collect Windows diagnostic data + if: ${{ runner.os == 'Windows' }} + run: | + systeminfo + route print + ipconfig /all + + - name: Run build and test + run: | + nox --non-interactive --error-on-missing-interpreters --session test pristine --python ${{ matrix.python }} + nox --non-interactive --session demo check_style docs + + - name: Save logs + uses: actions/upload-artifact@v3 + with: + name: PyCyphal-${{ matrix.os }}-python-${{ matrix.python }} + path: .nox/*/*/*.log + retention-days: 7 +