Skip to content

Commit

Permalink
Add CI #2 (#8)
Browse files Browse the repository at this point in the history
* Add basic files

* Use environment.yaml and simplify  verification script

* Add github workflow for conda and pytest

* Move config to correct folder

* Change env name in ci

* Use code from README

* Fix SyntaxError

* Again

* Try different env path

* Fix bug

* Try again

* Add pytest as dependency

* Again

* Again

* Again

* Again

* Again

* Add dummy test

* Fix bug

* Can I leave that out?

* Finalize Tests CI

* Rename ci file
  • Loading branch information
tostenzel committed Jan 2, 2024
1 parent 9a811da commit 0e21b1b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:

# Checkout the code at the commit (incl. branch) that triggered the workflow
- name: Checkout Repository
uses: actions/checkout@v2

# ------------------------------------------------------------------------------------------------------------------
# Resemble installation section in README.md
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: '.env'
environment-file: 'environment.yaml'
auto-activate-base: false

- name: Install edugrad
run: |
pip install -e .
# ------------------------------------------------------------------------------------------------------------------

- name: Run Tests
# Execute the commands in a bash login shell, ensuring that the shell's environment is fully initialized.
shell: bash -l {0}
run: |
pytest tests
3 changes: 3 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ channels:
- defaults
dependencies:
- numpy

# tests
- pytest
3 changes: 3 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

def test_dummy():
assert True == True

0 comments on commit 0e21b1b

Please sign in to comment.