Skip to content

Commit 6eb8ef8

Browse files
committed
Update workflow scripts
1 parent ffe3eee commit 6eb8ef8

7 files changed

Lines changed: 160 additions & 90 deletions

File tree

.github/workflows/build-ale.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
on:
3+
push:
4+
tags-ignore:
5+
- "*.*"
6+
paths-ignore:
7+
- "docs/**"
8+
branches:
9+
- "*"
10+
pull_request:
11+
branches:
12+
- "*"
13+
14+
jobs:
15+
pre-commit:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-python@v2
20+
- uses: pre-commit/action@v2.0.3
21+
22+
tests:
23+
name: ${{ matrix.runs-on }} • py${{ matrix.python }}
24+
needs: pre-commit
25+
defaults:
26+
run:
27+
shell: bash
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- runs-on: ubuntu-latest
33+
python: '3.7'
34+
triplet: x64-linux-mixed
35+
- runs-on: ubuntu-latest
36+
python: '3.8'
37+
triplet: x64-linux-mixed
38+
- runs-on: ubuntu-latest
39+
python: '3.9'
40+
triplet: x64-linux-mixed
41+
- runs-on: ubuntu-latest
42+
python: '3.10'
43+
triplet: x64-linux-mixed
44+
45+
- runs-on: macos-latest
46+
python: '3.7'
47+
triplet: x64-osx-mixed
48+
- runs-on: macos-latest
49+
python: '3.8'
50+
triplet: x64-osx-mixed
51+
- runs-on: macos-latest
52+
python: '3.9'
53+
triplet: x64-osx-mixed
54+
- runs-on: macos-latest
55+
python: '3.10'
56+
triplet: x64-osx-mixed
57+
58+
- runs-on: windows-latest
59+
python: '3.7'
60+
triplet: x64-windows
61+
- runs-on: windows-latest
62+
python: '3.8'
63+
triplet: x64-windows
64+
- runs-on: windows-latest
65+
python: '3.9'
66+
triplet: x64-windows
67+
- runs-on: windows-latest
68+
python: '3.10'
69+
triplet: x64-windows
70+
env:
71+
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
72+
runs-on: ${{ matrix.runs-on }}
73+
74+
steps:
75+
- uses: actions/checkout@v2
76+
77+
- uses: actions/setup-python@v2
78+
with:
79+
python-version: "3.x"
80+
81+
- name: Install pip dependencies
82+
run: |
83+
python -m pip install --user --upgrade -r tests/requirements.txt
84+
85+
- uses: microsoft/setup-msbuild@v1.1
86+
if: runner.os == 'Windows'
87+
- uses: lukka/get-cmake@latest
88+
- uses: lukka/run-vcpkg@v10
89+
with:
90+
vcpkgGitCommitId: "aebb363eaa0b658beb19cbefdd5aa2f9cbc14f1e"
91+
# There's a permissions issue with the cache
92+
# https://github.com/microsoft/vcpkg/issues/20121
93+
doNotCache: true
94+
95+
- name: Configure
96+
run: |
97+
cmake --version
98+
mkdir build && cd build
99+
cmake ../ -DSDL_SUPPORT=ON -DPython3_EXECUTABLE=$(which python)
100+
101+
- name: Build
102+
working-directory: build
103+
run: cmake --build . --config Debug --parallel 2
104+
105+
- name: Test
106+
working-directory: build
107+
run: ctest -C Debug --progress -VV
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
name: Release ale-py
1+
name: Release
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
8-
release:
9-
name: Release ale-py
8+
wheels:
109
runs-on: ubuntu-latest
1110
steps:
1211
- uses: actions/checkout@v2
1312
- uses: ./.github/actions/download-release-asset
14-
name: Download ale-py release asset
13+
name: Download release wheels
1514
with:
16-
filename: ale-py.zip
15+
filename: wheels.zip
1716
env:
1817
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
- name: Unzip ale-py asset
18+
- name: Unzip wheels asset
2019
run: |
21-
unzip ale-py.zip -d dist
20+
unzip wheels.zip -d dist
2221
- name: Publish to PyPi
2322
uses: pypa/gh-action-pypi-publish@release/v1
2423
with:
2524
user: __token__
2625
password: ${{ secrets.PYPI_TOKEN }}
26+
print_hash: true
Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build ALE Python
1+
name: Wheels
22

33
on:
44
push:
@@ -7,31 +7,48 @@ on:
77

88
jobs:
99
build:
10-
name: Build ALE Python for ${{ matrix.config.name }} ${{ matrix.config.arch }}
10+
name: ${{ matrix.runs-on }} ${{ matrix.arch }}
1111
defaults:
1212
run:
1313
shell: bash
1414
strategy:
1515
matrix:
1616
include:
17-
- config: {"name": "Linux", "os": "ubuntu-latest", "arch": "x86_64"}
18-
- config: {"name": "Windows", "os": "windows-latest", "arch": "AMD64"}
19-
- config: {"name": "macOS", "os": "macos-latest", "arch": "x86_64"}
20-
- config: {"name": "macOS", "os": "macos-latest", "arch": "arm64"}
21-
runs-on: ${{ matrix.config.os }}
17+
- runs-on: ubuntu-latest
18+
arch: x86_64
19+
- runs-on: windows-latest
20+
arch: AMD64
21+
- runs-on: macos-latest
22+
arch: x86_64
23+
- runs-on: macos-latest
24+
arch: arm64
25+
runs-on: ${{ matrix.runs-on }}
2226
steps:
2327
- uses: actions/checkout@v2
2428

25-
- name: Docker Login
26-
if: matrix.config.os == 'ubuntu-latest'
29+
- name: Setup Docker
30+
if: runner.os == 'Linux'
2731
run: docker login ghcr.io --username "${GITHUB_ACTOR}" --password "${GITHUB_CR_TOKEN}"
2832
env:
2933
GITHUB_CR_TOKEN: ${{ secrets.CR_TOKEN }}
3034

35+
- name: Setup msbuild
36+
if: runner.os == 'Windows'
37+
uses: microsoft/setup-msbuild@v1.1
38+
39+
- name: Setup vcpkg
40+
if: runner.os == 'macOS' || runner.os == 'Windows'
41+
uses: lukka/run-vcpkg@v10
42+
with:
43+
vcpkgGitCommitId: "aebb363eaa0b658beb19cbefdd5aa2f9cbc14f1e"
44+
# There's a permissions issue with the cache
45+
# https://github.com/microsoft/vcpkg/issues/20121
46+
doNotCache: true
47+
3148
- name: Build wheels
32-
uses: pypa/cibuildwheel@v2.3.1
49+
uses: pypa/cibuildwheel@v2.4.0
3350
env:
34-
CIBW_ARCHS: "${{ matrix.config.arch }}"
51+
CIBW_ARCHS: "${{ matrix.arch }}"
3552

3653
- name: Upload wheels
3754
uses: actions/upload-artifact@v2
@@ -41,7 +58,7 @@ jobs:
4158

4259

4360
pypi:
44-
name: Deploy ALE Python to PyPi test
61+
name: Deploy wheels to PyPi test
4562
runs-on: ubuntu-latest
4663
needs: build
4764
steps:
@@ -61,10 +78,11 @@ jobs:
6178
password: ${{ secrets.PYPI_TEST_TOKEN }}
6279
repository_url: https://test.pypi.org/legacy/
6380
packages_dir: wheels/
81+
print_hash: true
6482

6583

6684
release:
67-
name: Stage ALE Python to Github releases
85+
name: Stage wheels to Github releases
6886
runs-on: ubuntu-latest
6987
needs: build
7088
steps:
@@ -74,7 +92,7 @@ jobs:
7492

7593
- name: Create wheel archive
7694
run: |
77-
zip --junk-paths ale-py wheels/*
95+
zip --junk-paths wheels wheels/*
7896
7997
- name: Create release
8098
id: create_release
@@ -93,6 +111,6 @@ jobs:
93111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94112
with:
95113
upload_url: ${{ steps.create_release.outputs.upload_url }}
96-
asset_path: ./ale-py.zip
97-
asset_name: ale-py.zip
114+
asset_path: ./wheels.zip
115+
asset_name: wheels.zip
98116
asset_content_type: application/zip

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Arcade Learning Environment
44
</a>
55
===============================
66

7-
[![Build ALE](https://github.com/mgbellemare/Arcade-Learning-Environment/actions/workflows/build-ale.yml/badge.svg)](https://github.com/mgbellemare/Arcade-Learning-Environment/actions/workflows/build-ale.yml)
7+
[![Continuous Integration](https://github.com/mgbellemare/Arcade-Learning-Environment/actions/workflows/ci.yml/badge.svg)](https://github.com/mgbellemare/Arcade-Learning-Environment/actions/workflows/ci.yml)
88
[![PyPI Version](https://img.shields.io/pypi/v/ale-py)](https://pypi.org/project/ale-py)
99

1010

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
requires = [
33
"setuptools>=61",
44
"wheel",
5-
"cmake~=3.20.5",
5+
"cmake~=3.22",
66
"ninja; sys_platform != 'win32' and platform_machine != 'arm64'",
77
]
88
build-backend = "setuptools.build_meta"
@@ -41,8 +41,8 @@ dynamic = ["version"]
4141

4242
[project.optional-dependencies]
4343
test = [
44-
"pytest",
45-
"gym",
44+
"pytest>=7.0",
45+
"gym~=0.23",
4646
]
4747

4848
[project.urls]
@@ -67,6 +67,12 @@ packages = [
6767
package-dir = {ale_py = "src/python", gym = "src/gym"}
6868
package-data = {"ale_py.roms" = ["*.bin"]}
6969

70+
[tool.pytest.ini_options]
71+
minversion = "7.0"
72+
addopts = "-ra -q --ignore vcpkg --ignore build"
73+
testpaths = ["tests"]
74+
norecursedirs = ["vcpkg", "build"]
75+
7076
[tool.cibuildwheel]
7177
# Skip 32-bit wheels, PyPy & musllinux
7278
skip = ["*-win32", "*i686", "pp*", "*-musllinux*"]

tests/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pytest>=7.0
2+
gym~=0.23

0 commit comments

Comments
 (0)