Skip to content

Commit 01cb2d7

Browse files
cognifloydstackstorm-neptr
authored andcommitted
Use Github Actions instead of CirclecI
1 parent 1fb9751 commit 01cb2d7

File tree

3 files changed

+92
-107
lines changed

3 files changed

+92
-107
lines changed

.circleci/config.yml

Lines changed: 5 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,16 @@
11
version: 2
22

33
jobs:
4-
build_and_test_python36:
4+
circleci_is_disabled_job:
55
docker:
6-
- image: circleci/python:3.6
7-
- image: rabbitmq:3
8-
- image: mongo:3.4
9-
10-
working_directory: ~/repo
11-
12-
environment:
13-
VIRTUALENV_DIR: "~/virtualenv"
14-
# Don't install various StackStorm dependencies which are already
15-
# installed by CI again in the various check scripts
16-
ST2_INSTALL_DEPS: "0"
17-
6+
- image: cimg/base:stable
187
steps:
19-
- checkout
20-
- restore_cache:
21-
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
22-
- run:
23-
name: Download dependencies
24-
# NOTE: We don't want to use default "-e" option because this means
25-
# step will fail immediately on one of the commands failures and we
26-
# can't intercept the error and cause non-fatal exit in case pack
27-
# doesn't declare support for Python 3
28-
shell: /bin/bash
29-
# TODO: delete last 3 lines when StackStorm-Exchange/ci#101 is merged
30-
command: |
31-
git clone -b master git://github.com/stackstorm-exchange/ci.git ~/ci
32-
~/ci/.circle/dependencies ; ~/ci/.circle/exit_on_py3_checks $?
33-
echo "Setting up custom pack testing environment with tests/setup_testing_env.sh"
34-
source ~/virtualenv/bin/activate
35-
tests/setup_testing_env.sh
368
- run:
37-
name: Run tests (Python 3.6)
38-
# NOTE: We don't want to use default "-e" option because this means
39-
# step will fail immediately on one of the commands failures and we
40-
# can't intercept the error and cause non-fatal exit in case pack
41-
# doesn't declare support for Python 3
429
shell: /bin/bash
43-
# eventlet monkey_patch as early as possible (has to be in activate as nosetests gets reinstalled during test phase)
44-
command: |
45-
echo "grep -q monkey_patch ~/virtualenv/bin/nosetests || sed -i -e '/^import re$/i from st2common.util.monkey_patch import monkey_patch\nmonkey_patch()\n' ~/virtualenv/bin/nosetests" >> ~/virtualenv/bin/activate
46-
echo "grep -q pyopenssl\\.inject ~/virtualenv/bin/nosetests || sed -i -e '/^import re$/i from urllib3.contrib import pyopenssl\npyopenssl.inject_into_urllib3()\n' ~/virtualenv/bin/nosetests" >> ~/virtualenv/bin/activate
47-
~/ci/.circle/test ; ~/ci/.circle/exit_on_py3_checks $?
48-
- save_cache:
49-
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
50-
paths:
51-
- ~/.cache/pip
52-
- ~/.apt-cache
53-
# NOTE: We use virtualenv files from Python 3.6 step in "deploy" job so we
54-
# only persist paths from this job
55-
- persist_to_workspace:
56-
root: /
57-
paths:
58-
- home/circleci/ci
59-
- home/circleci/virtualenv
60-
- tmp/st2
61-
- home/circleci/repo
62-
- home/circleci/.gitconfig
63-
64-
65-
deploy:
66-
docker:
67-
- image: circleci/python:3.6
68-
69-
working_directory: ~/repo
70-
71-
environment:
72-
VIRTUALENV_DIR: "~/virtualenv"
73-
74-
steps:
75-
- checkout
76-
- restore_cache:
77-
key: v1-dependency-cache-py36-{{ checksum "requirements.txt" }}
78-
- attach_workspace:
79-
at: /
80-
- run:
81-
name: Install dependencies
82-
command: |
83-
sudo apt-get update
84-
sudo apt -y install gmic optipng
85-
~/ci/.circle/install_gh
86-
- run:
87-
# NOTE: We try to retry the script up to 5 times if it fails. The command could fail due
88-
# to the race (e.g. we try to push changes to index, but index has been updated by some
89-
# other pack in the mean time)
90-
name: Update exchange.stackstorm.org
91-
command: ~/ci/.circle/retry_on_failure.sh ~/ci/.circle/deployment
10+
command: echo CircleCI disabled on StackStorm-Exchange
9211

9312
workflows:
9413
version: 2
95-
# Workflow which runs on each push
96-
build_test_deploy_on_push:
97-
jobs:
98-
- build_and_test_python36
99-
- deploy:
100-
requires:
101-
- build_and_test_python36
102-
filters:
103-
branches:
104-
only: master
105-
build_test_weekly:
14+
circleci_is_disabled:
10615
jobs:
107-
- build_and_test_python36
108-
# Workflow which runs nightly - note we don't perform deploy job on nightly
109-
# build
110-
triggers:
111-
# Run nightly build for the pack
112-
- schedule:
113-
# NOTE: We run it at 1 am UTC on every Saturday
114-
cron: "0 1 * * 6"
115-
filters:
116-
branches:
117-
only:
118-
- master
16+
- circleci_is_disabled_job
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
schedule:
7+
# NOTE: We run this weekly at 1 am UTC on every Saturday
8+
- cron: '0 1 * * 6'
9+
10+
jobs:
11+
# This is based on this workflow, with an additional test env setup method
12+
# StackStorm-Exchange/ci/.github/workflows/pack-build_and_test.yaml@master
13+
14+
build_and_test:
15+
runs-on: ubuntu-latest
16+
name: 'Build and Test / Python ${{ matrix.python-version-short }}'
17+
strategy:
18+
matrix:
19+
include:
20+
- python-version-short: 3.6
21+
python-version: 3.6.13
22+
steps:
23+
- name: Checkout Pack Repo and CI Repos
24+
uses: StackStorm-Exchange/ci/.github/actions/checkout@master
25+
26+
- name: Install APT Dependencies
27+
uses: StackStorm-Exchange/ci/.github/actions/apt-dependencies@master
28+
with:
29+
cache-version: v0
30+
31+
- name: Install Python Dependencies
32+
uses: StackStorm-Exchange/ci/.github/actions/py-dependencies@master
33+
with:
34+
cache-version: v0
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install consul, vault, python hvac
38+
shell: bash
39+
run: |
40+
tests/setup_testing_env.sh
41+
42+
- name: Update virtualenv activate script
43+
# This works around an infinite recursion error with newer requests+ssl+eventlet.
44+
# eventlet monkey_patch as early as possible (has to be in activate as nosetests gets reinstalled during test phase)
45+
# See: https://github.com/StackStorm-Exchange/stackstorm-vault/pull/23
46+
run: |
47+
echo "grep -q monkey_patch ${VIRTUALENV_DIR}/bin/nosetests || sed -i -e '/^import re$/i from st2common.util.monkey_patch import monkey_patch\nmonkey_patch()\n' ${VIRTUALENV_DIR}/bin/nosetests" >> ${VIRTUALENV_DIR}/bin/activate
48+
echo "grep -q pyopenssl\\.inject ${VIRTUALENV_DIR}/bin/nosetests || sed -i -e '/^import re$/i from urllib3.contrib import pyopenssl\npyopenssl.inject_into_urllib3()\n' ${VIRTUALENV_DIR}/bin/nosetests" >> ${VIRTUALENV_DIR}/bin/activate
49+
50+
- name: Run pack tests
51+
uses: StackStorm-Exchange/ci/.github/actions/test@master
52+
with:
53+
enable-common-libs: false
54+
55+
services:
56+
mongo:
57+
image: mongo:3.4
58+
ports:
59+
- 27017:27017
60+
rabbitmq:
61+
image: rabbitmq:3
62+
ports:
63+
- 5672:5672
64+
#redis:
65+
# image: redis
66+
# ports:
67+
# - 6379:6379

.github/workflows/release.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
# the default branch
7+
- master
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build_and_test:
14+
name: 'Build and Test'
15+
uses: StackStorm-Exchange/stackstorm-vault/.github/workflows/build_and_test.yaml@master
16+
17+
tag_release:
18+
needs: build_and_test
19+
name: Tag Release
20+
uses: StackStorm-Exchange/ci/.github/workflows/pack-tag_release.yaml@master

0 commit comments

Comments
 (0)