forked from garmin/pyrex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Travis CI is no longer free, so transition to using GitHub Actions to do CI and release builds. Note that while coverage data is being collected, it's not currently being submitted to coveralls.io, as there doesn't appear to be good GitHub Actions integration for Python with coveralls
- Loading branch information
1 parent
7b24810
commit a81b154
Showing
9 changed files
with
191 additions
and
78 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[run] | ||
include = | ||
${TRAVIS_BUILD_DIR}/pyrex.py | ||
${GITHUB_WORKSPACE}/pyrex.py | ||
parallel = True | ||
data_file = ${TRAVIS_BUILD_DIR}/.coverage | ||
data_file = ${GITHUB_WORKSPACE}/.coverage | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- next | ||
pull_request: | ||
branches: | ||
- master | ||
- next | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
|
||
- name: Install python packages | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install \ | ||
black \ | ||
flake8 | ||
- name: Run black | ||
run: | | ||
black --check $(git ls-files '*.py') | ||
- name: Run flake8 | ||
run: | | ||
flake8 $(git ls-files '*.py') | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- {image: ubuntu-14.04-base, provider: docker, sh: bash} | ||
- {image: ubuntu-14.04-oe, provider: docker, sh: bash} | ||
- {image: ubuntu-16.04-base, provider: docker, sh: bash} | ||
- {image: ubuntu-16.04-oe, provider: docker, sh: bash} | ||
- {image: ubuntu-18.04-base, provider: docker, sh: bash} | ||
- {image: ubuntu-18.04-oe, provider: docker, sh: zsh } | ||
- {image: ubuntu-18.04-oetest, provider: docker, sh: bash} | ||
- {image: ubuntu-20.04-base, provider: docker, sh: bash} | ||
- {image: ubuntu-20.04-oe, provider: docker, sh: bash} | ||
- {image: ubuntu-20.04-oe, provider: podman, sh: bash} | ||
- {image: ubuntu-20.04-oetest, provider: docker, sh: bash} | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
env: | ||
USE_HELPER: "1" | ||
DOCKER_BUILDKIT: "1" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
|
||
- name: Prepare build | ||
run: ./ci/prepare.sh | ||
|
||
- name: Install packages | ||
run: | | ||
sudo mkdir -p /etc/containers/ | ||
echo -e "[registries.search]\nregistries = ['docker.io']\n" | sudo tee /etc/containers/registries.conf | ||
echo '{ "features": { "buildkit": true } }' | sudo tee /etc/docker/daemon.json | ||
sudo apt -y install \ | ||
diffstat \ | ||
fuse-overlayfs \ | ||
zsh | ||
- name: ${{ matrix.provider }} info | ||
run: ${{ matrix.provider }} info | ||
|
||
- name: Install python packages | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install coverage | ||
- name: Build image | ||
run: | | ||
./ci/build_image.py ${{ matrix.image }} --provider=${{ matrix.provider }} | ||
- name: Test image | ||
run: | | ||
export PYTHONPATH=${GITHUB_WORKSPACE}/ci/site/:$PYTHONPATH | ||
export COVERAGE_PROCESS_START=${GITHUB_WORKSPACE}/.coveragerc | ||
rm -f .coverage-report.* | ||
${{ matrix.sh }} -c "./ci/test.py -vb PyrexImage_${{ matrix.provider }}_$(echo ${{ matrix.image }} | sed 's/\W/_/g')" | ||
- name: Combine coverage | ||
run: | | ||
coverage3 combine | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
if: ${{ ( github.ref == 'refs/heads/next' || github.ref == 'refs/heads/master' ) && github.event_name == 'push' && matrix.provider == 'docker' }} | ||
|
||
- name: Push image | ||
run: | | ||
TAG="${GITHUB_REF##*/}" | ||
if [ "$TAG" = "master" ]; then | ||
TAG="latest" | ||
fi | ||
docker tag garminpyrex/${{ matrix.image }}:ci-test garminpyrex/${{ matrix.image }}:$TAG | ||
docker push garminpyrex/${{ matrix.image }}:$TAG | ||
if: ${{ ( github.ref == 'refs/heads/next' || github.ref == 'refs/heads/master' ) && github.event_name == 'push' && matrix.provider == 'docker' }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: release | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- image: ubuntu-14.04-base | ||
- image: ubuntu-14.04-oe | ||
- image: ubuntu-16.04-base | ||
- image: ubuntu-16.04-oe | ||
- image: ubuntu-18.04-base | ||
- image: ubuntu-18.04-oe | ||
- image: ubuntu-18.04-oetest | ||
- image: ubuntu-20.04-base | ||
- image: ubuntu-20.04-oe | ||
- image: ubuntu-20.04-oetest | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
env: | ||
USE_HELPER: "1" | ||
DOCKER_BUILDKIT: "1" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
|
||
- name: Prepare build | ||
run: ./ci/prepare.sh | ||
|
||
- name: Install packages | ||
run: | | ||
sudo apt install -y diffstat | ||
- name: Install python packages | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install requests | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Deploy image | ||
run: | | ||
export RELEASE_TAG="${GITHUB_REF##*/}" | ||
./ci/deploy_docker.py "${{ matrix.image }}:$RELEASE_TAG" | ||
This file was deleted.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import coverage | ||
|
||
coverage.current_coverage = coverage.process_startup() |
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