Skip to content

Commit da14b07

Browse files
committed
ci(github): introducing smoketest
1 parent 7e238c1 commit da14b07

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: login to Dockerhub (to prevent image trottling)
2+
runs:
3+
- name: docker login
4+
run: bash -ce 'echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin'
5+
env:
6+
DOCKERHUB_PASSWORD: {{ secrets.DOCKERHUB_PASSWORD }}
7+
DOCKERHUB_USERNAME: {{ secrets.DOCKERHUB_USERNAME }}

.github/actions/setup/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
description: "Python version to use"
55
required: true
66
type: string
7+
default: 3.12
8+
outputs:
9+
'python-version': ${{ inputs.python }}
710
runs:
811
using: "composite"
912
steps:

.github/workflows/main.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v5
1616
- uses: ./.github/actions/setup
17-
with:
18-
python: 3.12
1917
- name: Lint
2018
id: lint
2119
run: tox -e lint
@@ -42,3 +40,15 @@ jobs:
4240
python: ${{ matrix.python }}
4341
- name: Test
4442
run: tox
43+
smoketest:
44+
runs-on: ubuntu-latest
45+
needs: [ 'lint','test' ]
46+
steps:
47+
- uses: actions/checkout@v5
48+
- uses: ./.github/actions/setup
49+
id: setup
50+
- uses: ./.github/action/dockerhub-login
51+
- run: poetry build
52+
- run: ci/run_tests.sh
53+
env:
54+
SMOKETEST_DOCKER_IMAGE: python:${{ steps.setup.outputs.python-version }}

ci/run_tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env bash
22

3+
SMOKETEST_DOCKER_IMAGE=${SMOKETEST_DOCKER_IMAGE:-"python:3.11"}
4+
35
set -x
46
t=$([ -t 0 ] && echo 't')
57
docker run -q -i${t} --rm\
68
-v $PWD/dist:/dist -v $PWD/_appmap/test/data/unittest:/_appmap/test/data/unittest\
79
-v $PWD/ci:/ci\
810
-w /tmp\
911
-v $PWD/ci/readonly-mount-appmap.log:/tmp/appmap.log:ro\
10-
python:3.11 bash -ce "${@:-/ci/smoketest.sh; /ci/test_pipenv.sh; /ci/test_poetry.sh}"
12+
$SMOKETEST_DOCKER_IMAGE bash -ce "${@:-/ci/smoketest.sh; /ci/test_pipenv.sh; /ci/test_poetry.sh}"

0 commit comments

Comments
 (0)