generated from NASA-PDS/template-repo-java
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add branch continuous integration (#333)
* Add CI testing to branches * Add checkout of repo * Add shell * Add python version * Fix linter issues * Upgrade black dependency to fix bug Fixes bug that appears when trying to run pre-commit ImportError: cannot import name '_unicodefun' from 'click'
- Loading branch information
1 parent
b4c11b4
commit 0a00458
Showing
4 changed files
with
181 additions
and
105 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,76 @@ | ||
# 🏃♀️ Continuous Integration and Delivery: Branch Testing | ||
# ====================================================== | ||
|
||
|
||
--- | ||
|
||
name: 🔁 Branch integration testing | ||
|
||
|
||
# Driving Event | ||
# ------------- | ||
# | ||
# What event starts this workflow: a push to any branch other than main | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
- '!main' | ||
|
||
|
||
# What to Do | ||
# ---------- | ||
# | ||
# Test the software with tox | ||
|
||
jobs: | ||
branch-testing: | ||
name: 🪵 Branch Testing | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'pdsen-ci' | ||
|
||
steps: | ||
- | ||
name: 💳 Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
lfs: true | ||
fetch-depth: 0 | ||
token: ${{secrets.ADMIN_GITHUB_TOKEN}} | ||
- | ||
name: Set up Python 3 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.9' | ||
- | ||
name: 💵 Python Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
# The "key" used to indicate a set of cached files is the operating system runner | ||
# plus "py" for Python-specific builds, plus a hash of the wheels, plus "pds" because | ||
# we pds-prefix everything with "pds" in PDS! 😅 | ||
key: pds-${{runner.os}}-py-${{hashFiles('**/*.whl')}} | ||
# To restore a set of files, we only need to match a prefix of the saved key. | ||
restore-keys: pds-${{runner.os}}-py- | ||
- | ||
name: Update default configuration | ||
run: | | ||
import sys | ||
import os | ||
print("Running python version {}".format(sys.version)) | ||
conf_file = "pds_doi_service.ini" | ||
print("Create config file for unit test {}".format(conf_file)) | ||
with open(conf_file, "w") as f: | ||
f.write("[OSTI]\n") | ||
f.write("user = {}\n".format("${{secrets.osti_login}}")) | ||
f.write("password = {}\n".format("${{secrets.osti_password}}")) | ||
shell: python | ||
- | ||
name: 🩺 Test Software | ||
run: | ||
pip install --editable '.[dev]' | ||
|
||
tox | ||
shell: bash |
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
Oops, something went wrong.