Skip to content

Commit 8ec65e7

Browse files
Move all to one flow and cache pip
1 parent 1dc4124 commit 8ec65e7

File tree

1 file changed

+21
-34
lines changed

1 file changed

+21
-34
lines changed

.github/workflows/workflow.yml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,8 @@
33

44
on: push
55
jobs:
6-
test:
7-
name: Test and try publishing Python package
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout master
11-
uses: actions/checkout@master
12-
13-
- name: Set up Python
14-
uses: actions/setup-python@v2
15-
with:
16-
python-version: 3.8
17-
18-
- name: Install flit
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install flit
22-
23-
- name: Install package
24-
run: flit install
25-
26-
- name: run tests
27-
run: pytest record_api/test.py
28-
env:
29-
PYTEST_DISABLE_PLUGIN_AUTOLOAD: true
30-
- name: Try publishing to PyPi
31-
run: flit publish
32-
continue-on-error: true
33-
env:
34-
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
35-
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
366
build:
37-
needs: test
38-
name: Build and push Docker images
7+
name: Build, test and push Docker images
398
runs-on: ubuntu-latest
409
steps:
4110
- name: Checkout master
@@ -62,8 +31,14 @@ jobs:
6231
curl https://github.com/argoproj/argo/releases/download/v2.9.3/argo-linux-amd64 -L -o $GITHUB_WORKSPACE/bin/argo
6332
- name: Make bin executable
6433
run: chmod +x $GITHUB_WORKSPACE/bin/*
65-
- name: Verify argo
66-
run: argo
34+
- name: Cache pip
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/.cache/pip
38+
key: pip-${{ hashFiles('pyproject.toml') }}
39+
restore-keys: |
40+
pip-
41+
6742
- name: Install flit
6843
run: |
6944
python -m pip install --upgrade pip
@@ -107,6 +82,18 @@ jobs:
10782
working-directory: ./k8
10883
run: make buildx-driver
10984

85+
- name: run tests
86+
run: pytest record_api/test.py
87+
env:
88+
PYTEST_DISABLE_PLUGIN_AUTOLOAD: true
89+
90+
- name: Try publishing to PyPi
91+
run: flit publish
92+
continue-on-error: true
93+
env:
94+
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
95+
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
96+
11097
- name: Push images
11198
working-directory: ./k8
11299
run: make push-images

0 commit comments

Comments
 (0)