Skip to content
This repository was archived by the owner on May 17, 2022. It is now read-only.

Commit 5ce6324

Browse files
committed
First attempt with actions
1 parent 6021f57 commit 5ce6324

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

.github/workflows/on-push.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Push workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
10+
housekeeping:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Perform housekeeping checks
15+
env:
16+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
run: |
19+
source <(curl -sL http://ci.q-ctrl.com)
20+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 /scripts/housekeeping.sh
21+
22+
linting:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: Install Python dependencies
27+
env:
28+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
29+
run: |
30+
source <(curl -sL http://ci.q-ctrl.com)
31+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
32+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 /scripts/install-python-dependencies.sh
33+
- name: Run Pylint
34+
run: |
35+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 poetry run pylint_runner || true
36+
- name: Run Pylama
37+
run: |
38+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 poetry run pylama || true
39+
- name: Run Markdownlint
40+
run: |
41+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 mdl -- -ig . || true
42+
43+
pytest:
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
python: [36, 37]
48+
steps:
49+
- uses: actions/checkout@v1
50+
- name: Install Python dependencies
51+
env:
52+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
53+
run: |
54+
source <(curl -sL http://ci.q-ctrl.com)
55+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
56+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-${{ matrix.python }} /scripts/install-python-dependencies.sh
57+
- name: Run Pytest
58+
run: |
59+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-${{ matrix.python }} /scripts/pytest.sh
60+
61+
publish_internally:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v1
65+
- name: Publish development version
66+
env:
67+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
run: |
70+
source <(curl -sL http://ci.q-ctrl.com)
71+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
72+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 /scripts/publish-dev-version.sh

.github/workflows/on-release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release workflow
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Update version in code
14+
env:
15+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
run: |
18+
source <(curl -sL http://ci.q-ctrl.com)
19+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 /scripts/housekeeping.sh
20+
- name: Publish publicly
21+
env:
22+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
source <(curl -sL http://ci.q-ctrl.com)
26+
./ci vault login -r ${{ secrets.VAULT_ROLE_ID }} -s ${{ secrets.VAULT_SECRET_ID }}
27+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 /scripts/publish-release-publicly.sh
28+
- name: Publish internally
29+
env:
30+
GCLOUD_CONTAINER_AUTH: ${{ secrets.GCLOUD_CONTAINER_AUTH }}
31+
run: |
32+
./ci docker run asia.gcr.io/q-ctrl-api-development/python-37 /scripts/publish-release-internally.sh

0 commit comments

Comments
 (0)