Skip to content

Commit

Permalink
trying to get rust tests to work
Browse files Browse the repository at this point in the history
  • Loading branch information
robinsteuteville committed Feb 21, 2024
1 parent a464eda commit e160637
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 67 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/rust-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# name: rust-tests
name: rust-tests

# on:
# push:
# branches: [fastsim-2, fastsim-3]
# pull_request:
# workflow_dispatch:
# workflow_call:
on:
push:
branches: [fastsim-2, fastsim-3]
pull_request:
workflow_dispatch:
workflow_call:

# jobs:
# test:
# # might not be needed
# if: github.repository == 'nrel/fastsim'
jobs:
test:
# might not be needed
if: github.repository == 'nrel/fastsim'

# runs-on: ubuntu-latest
runs-on: ubuntu-latest

# strategy:
# fail-fast: true
strategy:
fail-fast: true

# if: contains(github.event.pull_request.changed_files, 'rust/')
# - name: install rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
if: contains(github.event.pull_request.changed_files, 'rust/')
- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# - name: Rust unit tests
# run: |
# cd rust/ && cargo test
- name: Rust unit tests
run: |
cd rust/ && cargo test
84 changes: 42 additions & 42 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: tests

on:
push:
branches: [fastsim-2, fastsim-3]
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
python-version: ['3.8', '3.9', '3.10']

env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Rust unit tests
run: |
cd rust/ && cargo test
- name: Python unit tests
run: |
pip install -e ".[dev]" && pytest -v python/fastsim/tests/
pytest -v python/fastsim/demos/
# name: tests

# on:
# push:
# branches: [fastsim-2, fastsim-3]
# pull_request:
# workflow_dispatch:

# jobs:
# test:
# runs-on: ubuntu-latest

# strategy:
# fail-fast: true
# matrix:
# python-version: ['3.8', '3.9', '3.10']

# env:
# PYTHON: ${{ matrix.python-version }}
# steps:
# - uses: actions/checkout@v3

# - name: set up python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: install rust
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true

# - name: Rust unit tests
# run: |
# cd rust/ && cargo test

# - name: Python unit tests
# run: |
# pip install -e ".[dev]" && pytest -v python/fastsim/tests/
# pytest -v python/fastsim/demos/
3 changes: 2 additions & 1 deletion .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:

jobs:
call-tests:
uses: nrel/fastsim/.github/workflows/rust-tests.yaml@main && nrel/fastsim/.github/workflows/py-tests.yaml@main
uses: nrel/fastsim/.github/workflows/rust-tests.yaml@main
# && nrel/fastsim/.github/workflows/py-tests.yaml@main
build:
name: build py3.${{ matrix.python-version }} on ${{ matrix.platform || matrix.os }}
strategy:
Expand Down

0 comments on commit e160637

Please sign in to comment.