updated dqn stack to work with cuda #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- ns_impl | |
pull_request: | |
branches: | |
- ns_impl | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ns_impl # Explicitly checking out the 'ns_impl' branch | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' # Specify the version of Python you need | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e . | |
pip install pytest | |
pip install "gymnasium[atari, accept-rom-license]" | |
- name: Run general tests for all changes | |
if: always() # Run general tests regardless of specific files changing | |
run: pytest tests/0_general/* | |
- name: Determine Changed Files | |
id: changes | |
run: | | |
git fetch origin ${{ github.event.before }} --depth=1 | |
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt | |
cat changed_files.txt | |
- name: Set Games to Test | |
id: set_games | |
run: | | |
# Initialize an empty list for games | |
GAMES="" | |
# Loop through changed files and set appropriate games | |
while IFS= read -r file; do | |
GAME_NAME=$(basename "$file" .py) | |
if [[ "$file" == *"/ram/"*".py" || "$file" == *"/vision/"*".py" ]]; then | |
# Capitalize the first letter of GAME_NAME | |
GAME_NAME="$(tr '[:lower:]' '[:upper:]' <<< ${GAME_NAME:0:1})${GAME_NAME:1}" | |
GAMES+="${GAME_NAME}" | |
fi | |
done < changed_files.txt | |
# Remove trailing space and export GAMES | |
GAMES=$(echo $GAMES | xargs) | |
echo "GAMES=$GAMES" >> $GITHUB_ENV | |
- name: Download Pickle Files | |
if: env.GAMES != '' | |
run: | | |
run: | | |
mkdir -p pickle_files | |
pip install gdown | |
gdown --folder https://drive.google.com/drive/u/0/folders/18391ILruGPBjsdUb2cHRIUEpOPmt6WPq -O pickle_files | |
- name: Run relevant tests | |
if: env.GAMES != '' | |
run: | | |
echo "Running tests with GAMES=$GAMES" | |
pytest tests/1_games/test_defaults.py | |
pytest tests/1_games/test_obj.py | |