Skip to content

preserve formatting of floats in edge cases #104

preserve formatting of floats in edge cases

preserve formatting of floats in edge cases #104

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
with:
firstParent: falseº
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
md5_command: md5sum
- os: macos-latest
md5_command: md5
- os: windows-latest
md5_command: md5sum
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Export workspace path
run: |
echo $GITHUB_WORKSPACE >> $GITHUB_PATH
- name: Compute cache key
id: compute-cache-key
run: |
echo "::set-output name=MD5_CACHE_KEY::$(${{ matrix.md5_command }} tox.ini setup.py setup.cfg requirements/*.txt | ${{ matrix.md5_command }} | head -c 32)"
- name: Restore cache
uses: actions/cache@v2
id: restore-cache
env:
CACHE_NUMBER: 0 # increase this number to force invalidate cache
with:
path: |
.tox
key: ${{ runner.os }}-${{ steps.compute-cache-key.outputs.MD5_CACHE_KEY }}-${{ env.CACHE_NUMBER }}
- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
python-version: 3.9
miniconda-version: latest
- name: Install tox ci
run: pip install -r requirements/ci.txt
- name: Run tests
env:
TOX_PARALLEL_NO_SPINNER: 1
run: |
tox --parallel --develop
- name: Archive tox logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: tox-logs
path: tox_logs/*
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs:
- commitlint
- tests
concurrency: release
permissions:
# to grant the user triggering the CI permission to push a new Release
contents: write
steps:
- name: Install Python for semantic releases
uses: actions/setup-python@v2
with:
python-version: '3.9.x'
- name: Checkout project
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 'main'
# a deploy key is needed because only the Admin users(and deploy keys) have permission to write to a protected
# branch(main). If this CI is triggered by another user's PR, because the main branch is protected and the CI
# GITHUB_TOKEN has the triggering user's permissions it won't be able to push the auto-generated commits that
# python-semantic-release does unless explicitly using a deploy key to do so
- name: Add SSH key for releasing
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.SP_AUTO_DEPLOY_KEY_UNITY_YAML_PARSER_UNITY_YAML_PARSER }}
# we cannot use python-semantic-release as a GitHub Action because it is executed inside a Docker image, and
# it does not work with the previous action which adds deploy ssh keys to the non-containerized environment
- name: Run semantic releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_USERNAME: __token__
REPOSITORY_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install -r requirements/publish.txt
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
semantic-release publish