Skip to content

Commit cde80f6

Browse files
authored
Merge pull request #73 from lesamouraipourpre/github-actions
Convert from Travis to Github Actions
2 parents 1b3ea7d + 734890c commit cde80f6

File tree

3 files changed

+83
-50
lines changed

3 files changed

+83
-50
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
# SPDX-FileCopyrightText: 2021 James Carr
3+
#
4+
# SPDX-License-Identifier: MIT
5+
6+
name: Build CI
7+
8+
on: [pull_request, push]
9+
10+
jobs:
11+
build-and-test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Dump GitHub context
15+
env:
16+
GITHUB_CONTEXT: ${{ toJson(github) }}
17+
run: echo "$GITHUB_CONTEXT"
18+
- name: Set up Python 3.7
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: 3.7
22+
- name: Versions
23+
run: |
24+
python3 --version
25+
- name: Checkout Current Repo
26+
uses: actions/checkout@v2
27+
- name: Install requirements
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install libudev-dev libusb-1.0
31+
sudo apt-get install -y gettext
32+
pip install -r requirements.txt
33+
- name: Library version
34+
run: git describe --dirty --always --tags
35+
- name: Install package locally
36+
run: pip install -e .
37+
- name: Test building single package
38+
run: |
39+
git clone https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git
40+
cd Adafruit_CircuitPython_FeatherWing
41+
circuitpython-build-bundles --filename_prefix test-single --library_location .
42+
- name: Test building bundle
43+
run: |
44+
# Use the community bundle because it's smaller and faster
45+
git clone --recurse-submodules https://github.com/adafruit/CircuitPython_Community_Bundle.git
46+
cd CircuitPython_Community_Bundle
47+
circuitpython-build-bundles --filename_prefix test-bundle --library_location libraries --library_depth 2
48+
- name: Build Python package
49+
run: |
50+
pip install --upgrade setuptools wheel twine readme_renderer testresources
51+
python setup.py sdist
52+
twine check dist/*

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
# SPDX-FileCopyrightText: 2021 James Carr
3+
#
4+
# SPDX-License-Identifier: MIT
5+
6+
name: Release Actions
7+
8+
on:
9+
release:
10+
types: [published]
11+
12+
jobs:
13+
upload-pypi:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Set up Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.7'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.pypi_username }}
28+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
29+
run: |
30+
python setup.py sdist
31+
twine upload dist/*

.travis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)