-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add pytest in GitHub Actions #9
Changes from 19 commits
921998d
0d6e434
22a9c18
8633c2c
8d0bcc9
fd71135
cd8250a
8ce82d2
65820a6
9ff5581
4676309
2c1698d
85ad3ca
400431a
f0c6af9
e880ad8
1f17500
60ff612
462e5d6
37488fd
27d9999
dc5e097
4a05a62
4316185
9ef8349
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# taken from https://github.com/e-mission/e-mission-server/blob/master/.github/workflows/test-with-manual-install.yml | ||
|
||
name: pytest | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
on: | ||
push: | ||
pull_request: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
test-pytest: | ||
# The type of runner that the job will run on | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniconda-version: "latest" | ||
auto-update-conda: true | ||
auto-activate-base: true | ||
|
||
- name: Run setup | ||
shell: bash -l {0} | ||
run: | | ||
set -x && . bin/setup.sh | ||
|
||
- name: Run pytest | ||
shell: bash -l {0} | ||
run: | | ||
. bin/run_pytest.sh | ||
|
||
test-jest: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '22' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run jest tests | ||
run: npx jest |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,9 @@ This repository uses the [Transcrypt](https://www.transcrypt.org/) library to co | |
|
||
## Setup | ||
|
||
``` | ||
Anaconda is required. | ||
|
||
```bash | ||
. bin/setup.sh | ||
``` | ||
|
||
|
@@ -21,7 +23,7 @@ Re-run this if you change the dependencies in `environment.yml` or `package.json | |
## To contribute | ||
|
||
1. Make your changes to Python code under the `src` directory. | ||
1. Run `bash bin/compile_to_js.sh` to build the JavaScript. This will produce output JS files in the `emcommon_js` directory. | ||
1. Run `bash bin/compile_to_js.sh` to build the JavaScript. This will produce output JS files in the `emcommon_js` directory. However, `pip install transcrypt` is required. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The setup script should automatically install |
||
1. Commit changes from both the `src` and `emcommon_js` directories to your branch. | ||
|
||
## Tips for writing code to work in both Python and JavaScript | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# taken from https://github.com/e-mission/e-mission-server/blob/master/setup/export_versions.sh | ||
|
||
export EXP_CONDA_VER=23.5.2 | ||
export EXP_CONDA_VER_SUFFIX=0 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's no diff here so I'm guessing you just made it executable, which is good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be necessary to install Anaconda manually, since the setup script automatically downloads miniconda and uses that.
Does this differ from what you've experienced?