forked from salesforce/policy_sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request salesforce#185 from kmcquade/refactor/move-from-tr…
…avis-to-github-actions Move from TravisCI to GitHub actions
- Loading branch information
Showing
3 changed files
with
120 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# .github/workflows/publish.yml | ||
|
||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install dependencies with pipenv | ||
run: | | ||
sleep 2m | ||
pip install pipenv | ||
pipenv install --dev --skip-lock | ||
- run: pipenv run invoke build.install-package | ||
- run: pipenv run invoke test.format | ||
- run: pipenv run invoke test.lint | ||
- run: pipenv run invoke integration.clean | ||
- run: pipenv run invoke integration.version | ||
- run: pipenv run invoke integration.initialize | ||
- run: pipenv run invoke unit.pytest | ||
- run: pipenv run invoke test.security | ||
- run: pipenv run invoke integration.query | ||
- run: pipenv run invoke integration.write-policy | ||
- run: pipenv run invoke build.uninstall-package | ||
|
||
publish-package: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: Install dependencies | ||
run: | | ||
pipenv install --dev | ||
- name: create python package | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git fetch --tags | ||
git pull origin master | ||
pipenv run python setup.py sdist bdist_wheel | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
|
||
update-brew: | ||
needs: publish-package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- uses: dschep/install-pipenv-action@v1 | ||
- name: publish brew | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
pipenv run pip install homebrew-pypi-poet | ||
pipenv run pip install policy_sentry -U | ||
git fetch origin | ||
git checkout --track origin/master | ||
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
echo "latest tag: $latest_tag" | ||
git pull origin $latest_tag | ||
pipenv run poet -f policy_sentry > HomebrewFormula/policy_sentry.rb | ||
git add . | ||
git commit -m "update brew formula" policy_sentry/bin/cli.py HomebrewFormula/policy_sentry.rb || echo "No brew changes to commit" | ||
git push -u origin master |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# .github/workflows/test.yml | ||
|
||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install dependencies with pipenv | ||
run: | | ||
pip install pipenv | ||
pipenv install --dev --skip-lock | ||
- run: pipenv run invoke build.install-package | ||
- run: pipenv run invoke test.format | ||
- run: pipenv run invoke test.lint | ||
- run: pipenv run invoke integration.clean | ||
- run: pipenv run invoke integration.version | ||
- run: pipenv run invoke integration.initialize | ||
- run: pipenv run invoke unit.pytest | ||
- run: pipenv run invoke test.security | ||
- run: pipenv run invoke integration.query | ||
- run: pipenv run invoke integration.write-policy | ||
- run: pipenv run invoke build.uninstall-package |
This file was deleted.
Oops, something went wrong.