-
Notifications
You must be signed in to change notification settings - Fork 1
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 #10 from phac-nml/gha
Gha
- Loading branch information
Showing
38 changed files
with
388 additions
and
801 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,35 @@ | ||
name: Branch Protection | ||
# This workflow is triggered on PRs to master branch on the repository | ||
# It fails when someone tries to make a PR against the `main` branch instead of `dev` | ||
on: | ||
pull_request_target: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PRs | ||
if: github.repository == 'phac-nml/profile_dists' | ||
run: | | ||
{ [[ ${{github.event.pull_request.head.repo.full_name }} == phac-nml/profile_dists]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] | ||
# If the above check failed, post a comment on the PR explaining the failure | ||
# NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets | ||
- name: Post PR comment | ||
if: failure() | ||
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 | ||
with: | ||
message: | | ||
## This PR is against the `main` branch :x: | ||
* Do not close this PR | ||
* Click _Edit_ and change the `base` to `dev` | ||
* This CI test will remain failed until you push a new commit | ||
--- | ||
Hello @${{ github.event.pull_request.user.login }}, This pull request is being made against the main branch, Please change your PR to be to the dev branch. | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
allow-repeats: false |
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,38 @@ | ||
|
||
|
||
name: profile_dists | ||
|
||
on: | ||
push: | ||
branches: ["main", "tests", "dev"] | ||
pull_request: | ||
branches: ["main", "tests", "dev"] | ||
|
||
|
||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-workflow==2.0.1 | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
pip install -e . | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest -o log_cli=true --git-aware |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
**__pycache__ | ||
*.pyc | ||
*.pyc | ||
build | ||
*.egg | ||
*.egg-info |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.