Skip to content

Commit

Permalink
Fix test matrix (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhovinne authored Jan 7, 2023
1 parent 4c30041 commit f357289
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 224 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install Task
run: |
sh -c "$(curl -ssL https://taskfile.dev/install.sh)" -- -d
echo "./bin" >> $GITHUB_PATH
- name: Test matrix
run: |
python3 -m venv /tmp/venv/
source /tmp/venv/bin/activate
./vendor/bin/task test-matrix
task test-matrix
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
dist/
venv/
*.egg-info/
__pycache__
28 changes: 16 additions & 12 deletions test-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,37 @@


async def test():
versions = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-rc"]
versions = ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12-rc']

async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
src = client.host().directory(".")
src = client.host().directory('.')
deb = 'https://github.com/go-task/task/releases/download/v3.19.1/task_linux_amd64.deb'

async def test_version(version: str):
python = (
client.container().from_(f"python:{version}-slim-buster")
.with_mounted_directory("/src", src)
.with_workdir("/src")
.with_exec(["./vendor/bin/task", "build"])
.with_exec(["./vendor/bin/task", "qa"])
.with_exec(["./vendor/bin/task", "test"])
client.container().from_(f'python:{version}-buster')
.with_mounted_directory('/src', src)
.with_workdir('/tmp')
.with_exec(['bash', '-c', f'wget {deb}'])
.with_exec(['bash', '-c', 'dpkg -i *.deb'])
.with_workdir('/src')
.with_exec(['task', 'build'])
.with_exec(['task', 'qa'])
.with_exec(['task', 'test'])
)

print(f"Starting tests for Python {version}")
print(f'Starting tests for Python {version}')

await python.exit_code()

print(f"Tests for Python {version} succeeded!")
print(f'Tests for Python {version} succeeded!')

async with anyio.create_task_group() as tg:
for version in versions:
tg.start_soon(test_version, version)

print("All tasks have finished")
print('All tasks have finished')


if __name__ == "__main__":
if __name__ == '__main__':
anyio.run(test)
1 change: 0 additions & 1 deletion vendor/bin/task

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/go-task/task/LICENSE

This file was deleted.

27 changes: 0 additions & 27 deletions vendor/go-task/task/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions vendor/go-task/task/completion/bash/task.bash

This file was deleted.

37 changes: 0 additions & 37 deletions vendor/go-task/task/completion/fish/task.fish

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/go-task/task/completion/ps/task.ps1

This file was deleted.

62 changes: 0 additions & 62 deletions vendor/go-task/task/completion/zsh/_task

This file was deleted.

Binary file removed vendor/go-task/task/task
Binary file not shown.

0 comments on commit f357289

Please sign in to comment.