diff --git a/.github/workflows/docs-rebuild.yaml b/.github/workflows/docs-rebuild.yaml index 826d7265..0a6415ba 100644 --- a/.github/workflows/docs-rebuild.yaml +++ b/.github/workflows/docs-rebuild.yaml @@ -1,4 +1,4 @@ -name: docs-rebuild-deploy +name: Documentation build & deploy trigger on: push: diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 1f605d1c..a8a0c9bb 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -1,3 +1,5 @@ +name: Dependencies images + on: push: tags: @@ -10,7 +12,7 @@ on: jobs: generate-matrix: name: Generate build matrix - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -22,7 +24,7 @@ jobs: build-and-push-arena-images: needs: [generate-matrix] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 if: ${{ needs.generate-matrix.outputs.matrix != '[]' }} strategy: fail-fast: true @@ -31,7 +33,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login to GHCR uses: docker/login-action@v2 @@ -76,7 +78,7 @@ jobs: build-and-push-agents-images: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') needs: [build-and-push-arena-images] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Build and Push Agents Images run: | diff --git a/.github/workflows/installation_tests.yaml b/.github/workflows/installation_tests.yaml new file mode 100644 index 00000000..ec75135f --- /dev/null +++ b/.github/workflows/installation_tests.yaml @@ -0,0 +1,71 @@ +name: Installation tests + +on: + push: + tags: + - "v*.*.*" + branches: + - main + pull_request: {} + schedule: + - cron: '30 2 * * *' + +jobs: + installation-tests: + runs-on: ubuntu-22.04 + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + installation-option: ['basic', 'stable-baselines', 'stable-baselines3', 'ray-rllib'] + python-packages-version: ['default', 'latest'] + + steps: + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Setup environment configuration (default or latest) + run: | + if [ "${{ matrix.python-packages-version }}" == 'latest' ]; then + python3 -m pip install -U pip + python3 -m pip install -U setuptools + fi + pip list + + - name: Pre-install packages needed because of various deprecations deprecation + run: | + python3 -m pip install -U wheel # Deprecated setup.py installation need to move to pyproject.toml + python3 -m pip install wheel==0.38.4 # Deprecated format of gym==0.21 setup.py + python3 -m pip install setuptools==66.0.0 # Deprecated format of gym==0.21 setup.py + pip list + + - name: Define Package Path + id: set_package_path + run: | + if [ "${{ github.event_name }}" == "schedule" ]; then + echo "package_path=diambra-arena" >> "$GITHUB_ENV" + else + echo "package_path=." >> "$GITHUB_ENV" + fi + + - name: Checkout Main Branch and Install Package + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) + uses: actions/checkout@v3 + + - name: Checkout Pull Request Branch and Install Package + if: github.event_name == 'pull_request' + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Install Package via pip + if: ( ( ( matrix.installation-option == 'stable-baselines' || matrix.installation-option == 'basic' ) && matrix.python-version == '3.7' ) || + ( matrix.installation-option != 'stable-baselines' && matrix.python-version != '3.7' ) ) + run: | + if [ "${{ matrix.installation-option }}" == "basic" ]; then + pip install ${{ env.package_path }} + else + pip install ${{ env.package_path }}[${{ matrix.installation-option }}] + fi + pip list diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d31a09c9..b69e3db7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,5 @@ +name: Python package Pypi release + on: push: tags: @@ -8,7 +10,7 @@ on: jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a71e673f..c06358bf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,9 +1,11 @@ +name: DIAMBRA Arena tests + on: pull_request: {} jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/.github/workflows/test_agents.yaml b/.github/workflows/test_agents.yaml index e3abcf93..52bece15 100644 --- a/.github/workflows/test_agents.yaml +++ b/.github/workflows/test_agents.yaml @@ -1,3 +1,5 @@ +name: DIAMBRA Agents tests + on: pull_request: {} diff --git a/setup.py b/setup.py index e35f0fed..b0fa9761 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ install_requires=[ 'pip>=21', 'importlib-metadata<=4.12.0; python_version <= "3.7"', # problem with gym for importlib-metadata==5.0.0 and python <=3.7 - 'setuptools<=66.0.0', # Required until we can upgrade to gym >= 0.22.0 + 'setuptools', 'distro>=1', 'gym<=0.21.0', 'inputs',