Improvements to GitHub CI (#140) #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python-opsramp GitHub Actions file | |
# | |
# (c) Copyright 2022-2024 Hewlett Packard Enterprise Development LP | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: Unit test | |
on: | |
pull_request: | |
merge_group: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
# Deliberately run on Python 3.10 rather than "latest". | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/[email protected] | |
- name: set up environment | |
run: | | |
set -eux | |
python3 --version | |
python3 -m pip --version | |
python3 -m pip install --upgrade pip | |
pip --version | |
pip install --upgrade build wheel tox | |
pip freeze | |
- name: PEP517 build | |
run: | | |
set -eux | |
rm -rf python_opsramp.egg-info | |
python3 -m build | |
- name: setuptools build | |
run: | | |
set -eux | |
rm -rf python_opsramp.egg-info | |
python3 setup.py sdist bdist_wheel | |
- name: unit tests | |
run: | | |
set -eux | |
pip install --upgrade -r requirements.txt -r test-requirements.txt | |
./runtests.sh |