Skip to content

Commit

Permalink
Merge pull request #30 from blink1073/test-other-actions
Browse files Browse the repository at this point in the history
Add some testing of actions
  • Loading branch information
blink1073 authored Dec 9, 2021
2 parents 98dbb29 + 762c6d3 commit 0723cf0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/actions/binder-link/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ runs:
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
var PR_HEAD_REF = process.env.PR_HEAD_REF;
var URL_PATH = process.env.URL_PATH;
github.issues.createComment({
var BODY = `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=${URL_PATH}) :point_left: Launch a Binder on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`;
var CONTENT = {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=${URL_PATH}) :point_left: Launch a Binder on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
})
body: BODY
};
if ("${{ inputs.github_token }}" !== "FAKE") {
github.issues.createComment($CONTENT);
}
env:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/downstream-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
# Test the downstream package
eval ${test_command}
eval ${extra_test}
eval "${{inputs.extra_test}}"
# Cleanup
rm -rf ./test_venv
54 changes: 54 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["*"]

jobs:
downstream_defaults:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Base Setup
uses: ./.github/actions/base-setup
- name: Create a mock python package
run:
echo "from setuptools import setup; setup(name='foo')" > setup.py
- name: Check Downstream test with defaults
uses: ./.github/actions/downstream-test
with:
package_name: jupyter_client

downstream_overrides:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Base Setup
uses: ./.github/actions/base-setup
- name: Create a mock python package
run:
echo "from setuptools import setup; setup(name='foo')" > setup.py
- name: Check Downstream test with overrides
uses: ./.github/actions/downstream-test
with:
package_name: nbclient
package_spec: "nbclient[test] ipykernel"
test_command: "echo 'hello'"
extra_test: "pytest --pyargs nbclient"
env_values: IPYKERNEL_CELL_NAME=\<IPY-INPUT\>

binder_link:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Base Setup
uses: ./.github/actions/base-setup
- name: Check Binder Link
uses: ./.github/actions/binder-link
with:
github_token: "FAKE"
url_path: "/foo/bar"

0 comments on commit 0723cf0

Please sign in to comment.