generated from jonn-smith/python_cli_template
-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (54 loc) · 1.75 KB
/
ci_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Continuous integration test of any branch.
name: CI
on:
push:
branches-ignore:
- main
jobs:
# Run test suite
test_suite:
runs-on: ubuntu-20.04
steps:
- name: Work around permissions issue
run: git config --global --add safe.directory /__w/longbow/longbow
- uses: 'actions/checkout@v2'
- uses: actions/setup-python@v2
with:
python-version: '3.7.9'
architecture: 'x64'
# - name: wget
# uses: wei/wget@v1
# with:
# args: -O /usr/local/bin/starcode https://github.com/gui11aume/starcode/releases/download/1.4/starcode-1.4
- name: pytest
run: |-
wget -O /usr/local/bin/starcode https://github.com/gui11aume/starcode/releases/download/1.4/starcode-1.4
chmod 755 /usr/local/bin/starcode
echo "/usr/local/bin" >> $GITHUB_PATH
starcode --help
python3 -mvenv venv
. venv/bin/activate
pip install --upgrade pip
pip3 install -r test-requirements.txt
pip3 install -r dev-requirements.txt
pip install -e .
pytest
# Build Docker image
build_docker:
runs-on: ubuntu-latest
steps:
- name: Work around permissions issue
run: git config --global --add safe.directory /__w/longbow/longbow
- uses: 'actions/checkout@v2'
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: Image
run: |-
TAG=$(git rev-parse --abbrev-ref HEAD)
cd docker
docker build --build-arg branch=$TAG -t us.gcr.io/broad-dsp-lrma/lr-longbow:$TAG .
gcloud auth configure-docker -q
docker push -q us.gcr.io/broad-dsp-lrma/lr-longbow:$TAG