-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (70 loc) · 2.19 KB
/
ci_pkg-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Install package
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
defaults:
run:
shell: bash
jobs:
pkg-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Check package
run: |
pip install check-manifest
check-manifest
python setup.py check --metadata --strict
- name: Create package
run: |
pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel
- name: Verify package
run: |
pip install -q -r tests/requirements.txt
twine check dist/*
python setup.py clean
pkg-install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.8"] #, 3.9
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create package
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel
- name: Try installing
working-directory: dist
run: |
ls -lh
pip install $(python -c "import glob ; print(' '.join(glob.glob('*.whl')))")
pip show kaggle-sandbox
python -c "import challenge_xyz ; print(challenge_xyz.__version__)"
watcher:
runs-on: ubuntu-latest
needs: ["pkg-install", "pkg-check"]
if: always()
steps:
- run: echo "${{ needs.pkg-install.result }}"
- name: failing...
if: needs.pkg-install.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pkg-install.result)
timeout-minutes: 1
run: sleep 90