Skip to content

Commit

Permalink
Update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
artemy committed Dec 23, 2020
1 parent 80a5863 commit ced68f0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
43 changes: 18 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,23 @@ on: push

jobs:
test:
name: test & release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test
run: python -m unittest ns_schedule
release:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Build artifacts
run: make
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: '*.alfredworkflow'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Set up Python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Test
run: make test
- name: Build artifact
if: startsWith(github.ref, 'refs/tags/')
run: make build
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: '*.alfredworkflow'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
PYTHON=python2
PIP=pip
NS_SCHEDULE_PY=ns_schedule.py
NS_SCHEDULE_TEST_PY=ns_schedule_test.py
ALFRED_FILE_NAME=NS_Schedule
ALFRED_PACKAGE_FILES=./alfred/*

.PHONY: clean build alfred
.PHONY: clean test build

all: clean test alfred
all: clean test build

clean:
rm -fr out *.alfredworkflow

test:
$(PYTHON) -m pip install --upgrade pip
$(PIP) install -r requirements.txt
$(PYTHON) $(NS_SCHEDULE_TEST_PY)

alfred:
zip -j -r $(ALFRED_FILE_NAME).alfredworkflow $(ALFRED_PACKAGE_FILES) $(NS_SCHEDULE_PY)
build:
zip -j -r $(ALFRED_FILE_NAME).alfredworkflow $(ALFRED_PACKAGE_FILES) $(NS_SCHEDULE_PY)

0 comments on commit ced68f0

Please sign in to comment.