Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow to migrate from circleCI to Github actions #268

Merged
merged 18 commits into from
Mar 21, 2024
47 changes: 47 additions & 0 deletions .github/workflows/build-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Test & Coverage
on:
[pull_request, push]

jobs:

test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Run tests
run: |
pip install -q -U pip
pip install -q pipenv
pipenv install --dev
pipenv run pytest --cov-report=xml --cov=newrelic_lambda_cli tests
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true

code-style:
name: Code style
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check code style
run: |
pip install -q -U pip
pip install -q -U 'black<22.10.1'
black --check newrelic_lambda_cli tests
- name: Check README
run: |
pip install -q -U pip
pip install -q -U setuptools twine wheel
python setup.py sdist bdist_wheel
twine check dist/*
27 changes: 27 additions & 0 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Test & Release Assets
on:
release:
types: [published]

jobs:

release:
name: Release package
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install release dependencies
run: |
pip install -q -U pip
pip install -q -U pyOpenSSL setuptools twine wheel
- name: Release package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.NEWRELIC_PYPI }}
run: |
python3 setup.py sdist bdist_wheel
twine check dist/*
twine upload --non-interactive dist/*
Loading