File: ci.yml

package info (click to toggle)
getmac 0.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 976 kB
  • sloc: python: 2,133; sh: 84; makefile: 23
file content (142 lines) | stat: -rw-r--r-- 4,857 bytes parent folder | download
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI

on:
- release
- push
- pull_request

jobs:
  lint:
    name: Run lint checks
    runs-on: ubuntu-20.04
    # Workaround to disable pip upgrade warnings until fixed in setup-python
    # See: https://github.com/actions/setup-python/issues/532
    env:
      PIP_DISABLE_PIP_VERSION_CHECK: 1
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: "3.8"
      - name: Install tox
        run: python -m pip install tox
      - name: Run lint checks
        run: tox -e check
  test:
    name: Run tests
    runs-on: ${{ matrix.platform }}
    # Workaround to disable pip upgrade warnings until fixed in setup-python
    # See: https://github.com/actions/setup-python/issues/532
    env:
      PIP_DISABLE_PIP_VERSION_CHECK: 1
    strategy:
      fail-fast: false
      # Versions available:
      # pypy: https://downloads.python.org/pypy/versions.json
      # Python: https://github.com/actions/python-versions/blob/main/versions-manifest.json
      # Additional info: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md
      # OS images: https://github.com/actions/runner-images
      matrix:
        python-version:
          - "3.7"
          - "3.8"
          - "3.9"
          - "pypy-3.7"
          - "pypy-3.8"
          - "pypy-3.9"
        architecture:
          - x86
          - x64
        platform:
          - ubuntu-20.04
          - windows-latest
          # Fix tests failing on MacOS 14+ due to ARM architecture
          # https://github.com/actions/setup-python/issues/825
          # TODO: update tests to use ARM MacOS with 14+, add 
          # architecture to the list of architectures above.
          - macos-13
        exclude:
          - platform: ubuntu-20.04
            architecture: x86
          - platform: macos-13
            architecture: x86
          - platform: macos-13
            python-version: "pypy-3.7"
          - platform: macos-13
            python-version: "pypy-3.8"
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          architecture: ${{ matrix.architecture }}
      - name: Display platform and environment information
        run: |
          python --version
          python -c "import sys; print('sys.version: %s' % str(sys.version))"
          python -c "import sys; print('sys.platform: %s' % str(sys.platform))"
          python -c "import os; print('os.name: %s' % str(os.name))"
          python -c "import platform; print('platform.uname(): %s' % str(platform.uname()))"
      - name: Install dependencies
        run: python -m pip install tox coveralls tox-gh-actions
      # TODO: fix benchmark results (maybe a separate Job?)
      - name: Run tests
        run: tox
      - uses: codecov/codecov-action@v3
        with:
          # codecov is annoying. Not sure why I'm still using it, 
          # may need to look at something that has less heisenbugs.
          # https://community.codecov.com/t/ci-failure-due-to-too-many-uploads-to-this-commit/2587/12
          fail_ci_if_error: false
      - name: Coveralls
        if: ${{ matrix.platform == 'ubuntu-20.04' && github.event_name != 'pull_request' }}
        uses: AndreMiras/coveralls-python-action@develop
        with:
          parallel: true
          flag-name: ${{ matrix.python-version }}-${{ matrix.platform }}
  coveralls_finish:
    needs: test
    runs-on: ubuntu-20.04
    steps:
    - name: Coveralls Finished
      if: ${{ github.event_name != 'pull_request' }}
      uses: AndreMiras/coveralls-python-action@develop
      with:
        parallel-finished: true


# TODO: publish
# TODO: need to do this for both "getmac" and "get-mac" packages
# TODO: don't publish pre-releases OR publish them as pre-releases to PyPI

# https://github.com/marketplace/actions/upload-a-build-artifact

# name: "Build and publish a release"

# on:
#   release:
#     types: [released]

# jobs:
#   publish:
#     name: "📦 Publish Python distributions"
#     runs-on: "ubuntu-20.04"
#     strategy:
#       matrix:
#         python-version:
#           - "3.8"
#     steps:
#       - uses: actions/checkout@v3
#       - name: "🐍 Set up Python ${{ matrix.python-version }}"
#         uses: actions/setup-python@v4
#         with:
#           python-version: "${{ matrix.python-version }}"
#       - name: "🐍 Install wheel"
#         run: "python -m pip install wheel --user"
#       - name: "🐍 Build a binary wheel and a source tarball"
#         run: "python setup.py sdist bdist_wheel"
#       - name: "📦 Publish distribution to PyPI"
#         uses: "pypa/gh-action-pypi-publish@master"
#         if: "startsWith(github.ref, 'refs/tags')"
#         with:
#           password: "${{ secrets.pypi_password }}"