-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update pipenv to work with public pypi, on centos:7 * Put spops calls behind if statements for now * Make changes needed for rollback to python 3.6 * Update cargo deps to public url for spfs * Add docker based build of rpm file * Update readme with information for building locally * Add actions for building in github CI
- Loading branch information
Showing
17 changed files
with
350 additions
and
214 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.git/ | ||
target/ | ||
.vscode/ | ||
docs/ | ||
examples/ | ||
packages/ | ||
.github/ | ||
__pycache__/ | ||
*.so | ||
*.egg-info/ |
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,20 @@ | ||
name: Python | ||
|
||
on: push | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: sudo pip3 install pipenv | ||
- run: pipenv sync --dev | ||
- name: Lint Formatting with Black | ||
run: pipenv run -- black --check | ||
- name: Lint Typing with MyPy | ||
run: pipenv run -- mypy spk | ||
# TODO: find a way to run the unit test suite... it needs an installation | ||
# of spfs and we currently only produce a centos rpm that's not easy to use here |
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,23 @@ | ||
name: RPM Build | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: echo RPM_NAME=$(rpmspec -q spk.spec | head -n1) >> $GITHUB_ENV | ||
- run: echo Building ${{ env.RPM_NAME }}.rpm | ||
- name: build RPM package | ||
env: | ||
SPFS_PULL_USERNAME: ${{ secrets.SPFS_PULL_USERNAME }} | ||
SPFS_PULL_PASSWORD: ${{ secrets.SPFS_PULL_PASSWORD }} | ||
run: make rpm | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Binary RPM | ||
path: dist/rpm/RPMS/x86_64/${{ env.RPM_NAME }}.rpm | ||
# TODO: find a way to run the unit test suite... it needs an installation | ||
# of spfs and we currently only produce a centos rpm that's not easy to use here |
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,29 @@ | ||
name: Rust | ||
|
||
on: push | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: cargo fmt -- --check | ||
build: | ||
runs-on: ubuntu-18.04 | ||
env: | ||
SPFS_PULL_USERNAME: ${{ secrets.SPFS_PULL_USERNAME }} | ||
SPFS_PULL_PASSWORD: ${{ secrets.SPFS_PULL_PASSWORD }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: sudo apt-get install -y libcap-dev | ||
- run: sudo pip3 install pipenv | ||
- name: Patch spfs Pull Auth | ||
run: sed -i "s|github.com|$SPFS_PULL_USERNAME:$SPFS_PULL_PASSWORD@github.com|" Cargo.toml | ||
- run: pipenv sync --dev | ||
- name: Build | ||
run: pipenv run -- cargo build --verbose | ||
- name: Run tests | ||
run: pipenv run -- cargo test --verbose --no-default-features |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
VERSION = $(shell cat spk.spec | grep Version | cut -d ' ' -f 2) | ||
SOURCE_ROOT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
.PHONY: rpm devel test | ||
default: devel | ||
|
||
devel: | ||
cd $(SOURCE_ROOT) | ||
pipenv run -- python setup.py develop | ||
|
||
test: | ||
cd $(SOURCE_ROOT) | ||
pipenv run -- spfs run - -- pytest | ||
|
||
rpm: SPFS_PULL_USERNAME ?= $(shell read -p "Github Username: " user; echo $$user) | ||
rpm: SPFS_PULL_PASSWORD ?= $(shell read -s -p "Github Password/Access Token: " pass; echo $$pass) | ||
rpm: | ||
cd $(SOURCE_ROOT) | ||
docker build . \ | ||
-f rpmbuild.Dockerfile \ | ||
--build-arg VERSION=$(VERSION) \ | ||
--build-arg SPFS_PULL_USERNAME=$(SPFS_PULL_USERNAME) \ | ||
--build-arg SPFS_PULL_PASSWORD=$(SPFS_PULL_PASSWORD) \ | ||
--tag spk-rpm-builder | ||
mkdir -p dist/rpm | ||
CONTAINER=$$(docker create spk-rpm-builder) \ | ||
&& docker cp $$CONTAINER:/root/rpmbuild/RPMS dist/rpm/ \ | ||
&& docker rm --force $$CONTAINER |
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
Oops, something went wrong.