diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..3691eca --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,48 @@ +# taken from https://github.com/e-mission/e-mission-server/blob/master/.github/workflows/test-with-manual-install.yml + +name: unit-tests + +# 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: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run setup.sh + shell: bash -l {0} + run: | + source bin/setup.sh + + - name: Run pytest + shell: bash -l {0} + run: | + source 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: '20' + + - name: Run setup.sh + shell: bash -l {0} + run: | + source bin/setup.sh + + - name: Run jest tests + shell: bash -l {0} + run: | + source bin/run_jest.sh diff --git a/README.md b/README.md index 4dc3ab1..b1f891d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This repository uses the [Transcrypt](https://www.transcrypt.org/) library to co ## Setup -``` +```bash . bin/setup.sh ``` @@ -126,3 +126,7 @@ There may be testing scenarios that must significantly diverge between Python an ```bash . bin/run_jest.sh ``` + +### GitHub Actions + +The unit tests also run via an Actions workflow, which executes both `run_pytest.sh` and `run_jest.sh` on each commit or PR to `master`. diff --git a/bin/compile_to_js.sh b/bin/compile_to_js.sh old mode 100644 new mode 100755 diff --git a/bin/run_jest.sh b/bin/run_jest.sh old mode 100644 new mode 100755 diff --git a/bin/run_pytest.sh b/bin/run_pytest.sh old mode 100644 new mode 100755 diff --git a/bin/setup.sh b/bin/setup.sh old mode 100644 new mode 100755