-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate CI to github actions #677
Merged
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
5afebcd
initial gh actions workflow
thatbudakguy dce0c5b
remove errant backtick
thatbudakguy e5bcb9c
add solr setup steps
thatbudakguy 31f3bb1
create test db; add dep caching
thatbudakguy 07955af
start mysql service
thatbudakguy 44d904b
use default mysql password
thatbudakguy 055b29f
add root password to testsettings
thatbudakguy 3b215b8
fix caching step order
thatbudakguy 112289b
add webpack build step
thatbudakguy 65e48c8
separate out static file builds
thatbudakguy 4a1f2bc
add install step
thatbudakguy 1539ae6
upload webpack stats file
thatbudakguy 32eaaba
try using codecov flags
thatbudakguy 095ae5b
edit python coverage path
thatbudakguy 0b6c8dd
remove travis
thatbudakguy e08e5fc
update README badge
thatbudakguy 0183c8d
update sitemap to use main sitemap
thatbudakguy b9851de
add a11y testing job
thatbudakguy 129ceeb
install pa11y-ci
thatbudakguy f689cd8
expand list of URLs crawled by pa11y
thatbudakguy a6146c9
try using service containers
thatbudakguy b3468aa
array syntax for service container volumes
thatbudakguy 3481d47
specify solr conf dir using workspace envvar
thatbudakguy 62d8694
use different collection name
thatbudakguy d055c34
try a different path
thatbudakguy 6df52d3
try manually creating core
thatbudakguy 2e58327
don't run main build in container
thatbudakguy 93bf605
try manually copying core conf
thatbudakguy df9ec68
try using shared volume
thatbudakguy b8e75ff
try using docker cp
thatbudakguy 7aa992a
re-bind ports
thatbudakguy f1671ea
change host param for db
thatbudakguy f87c662
change permissions of solr conf directory
thatbudakguy 4b8bf8c
sudo
thatbudakguy c807880
use privileged flag
thatbudakguy aef5c6a
try...everything
thatbudakguy 1a046b4
try the ol' 777
thatbudakguy 48db027
try to su root
thatbudakguy 5829df6
try using solr-precreate command
thatbudakguy 141f656
use precreate-core command
thatbudakguy 32b5053
restart solr container prior to creating core
thatbudakguy f51784a
use compose file to orchestrate containers
thatbudakguy ee82efd
use config_solr script but keep db in docker
thatbudakguy 9f35dfa
add SOLR_VERSION env
thatbudakguy 39c0bec
try node matrix
thatbudakguy c048751
test python matrix
thatbudakguy 0ac5e59
update py version caches; change pa11y command
thatbudakguy e42a55e
set up lighthouse ci
thatbudakguy a76d3b4
pass in lhci github token
thatbudakguy 985a56b
add lighthouse URLs and set readyPattern
thatbudakguy 3531f3a
fix urls, try letting lighthouse serve static/
thatbudakguy 0bf7ad6
don't serve static with lighthouse
thatbudakguy 02c858f
update webpack stats file path
thatbudakguy 56f5b3e
rename and separate stats/bundle
thatbudakguy e2c2d6b
make a11y dependent on other tests; pull out NODE_VERSION
thatbudakguy 84b5f2b
re-add webpack bundle to py unit tests
thatbudakguy e71dc1f
add more URLs to test with lighthouse
thatbudakguy aef9dcc
remove lighthouse from CI
thatbudakguy 3a96864
update from develop
thatbudakguy fb59bcd
remove lighthouse token from ci workflow
thatbudakguy 97f085c
make python unit tests depend on webpack build
thatbudakguy 34751a3
Try using Solr service
rlskoeser 3070e18
Rename ci/unit test workflow
rlskoeser 3ca5e5d
Add python version file; remove matrix build strategy
rlskoeser d51546f
Add wheel to dev requirements
rlskoeser 8f57e84
Use python version 3.5.4 since 3.5.1 is unavailable
rlskoeser eeb8c16
Create project configset using Solr ConfigSets API
rlskoeser 06d324f
Try using docker cp to get configset files to Solr service container
rlskoeser 439a795
Try using context variable to get id for solr service container
rlskoeser 555789c
Require wagtail < 2.10 since production is still python 3.5 for now
rlskoeser 0ef20ca
Try setting ownership on configset files in service container
rlskoeser a8ede18
Revise slack notification message
rlskoeser 402c1e7
Merge branch 'develop' into thatbudakguy/issue634
rlskoeser 826fd50
Revise slack message format
rlskoeser dfea8d1
Tweak slack message
rlskoeser cfc4ec0
Abandon attempts to get short ref for slack message
rlskoeser d09e53b
Try waiting longer after indexing test data in solr
rlskoeser 9589c3d
Remove formatting from slack message title
rlskoeser fc86a12
Merge branch 'develop' into thatbudakguy/issue634
rlskoeser 96c2e61
Remove pa11y-ci references and lighthouse config
rlskoeser d9bbf8e
Merge branch 'develop' into thatbudakguy/issue634
rlskoeser cffefbb
Try using parasolr<0.6 to resolve issue with stats for search forms
rlskoeser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
name: unit_tests | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
NODE_VERSION: 10 | ||
SOLR_VERSION: 6.6.5 | ||
|
||
jobs: | ||
|
||
build-static: | ||
name: Build static files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Setup node | ||
uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: npm-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
npm-${{ hashFiles('package-lock.json') }} | ||
npm- | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run webpack build | ||
run: npm run build:prod | ||
- name: Upload built files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: bundles | ||
path: bundles/ | ||
- name: Upload stats file | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: webpack-stats.json | ||
path: webpack-stats.json | ||
|
||
ts-unit: | ||
name: TypeScript unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Setup node | ||
uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: npm-${{ hashFiles('package-lock.json') }} | ||
restore-keys: | | ||
npm-${{ hashFiles('package-lock.json') }} | ||
npm- | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run Jest | ||
run: npx jest --collectCoverage | ||
- name: Upload test coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
flags: typescript | ||
|
||
py-unit: | ||
name: Python unit tests | ||
runs-on: ubuntu-latest | ||
needs: build-static | ||
services: | ||
db: | ||
image: mariadb | ||
env: | ||
MYSQL_DATABASE: sandco | ||
MYSQL_ROOT_PASSWORD: sandco | ||
ports: | ||
- 3306:3306 | ||
solr: | ||
image: solr:6.6 | ||
ports: | ||
- 8983:8983 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# use docker cp to copy the configset, then bash to set ownership to solr | ||
- name: Copy Solr configset to solr service | ||
run: | | ||
docker cp solr_conf ${{ job.services.solr.id }}:/opt/solr/server/solr/configsets/sandco | ||
docker exec --user root ${{ job.services.solr.id }} /bin/bash -c "chown -R solr:solr /opt/solr/server/solr/configsets/sandco" | ||
|
||
# Python version to use is stored in the .python-version file, which is the | ||
# convention for pyenv: https://github.com/pyenv/pyenv | ||
- name: Get Python version | ||
run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
pip-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} | ||
pip-${{ matrix.python }} | ||
pip- | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r dev-requirements.txt | ||
|
||
- name: Download webpack stats | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: webpack-stats.json | ||
|
||
- name: Setup local_settings.py | ||
run: | | ||
cp ci/testsettings.py mep/local_settings.py | ||
python -c "import uuid; print('SECRET_KEY = \'%s\'' % uuid.uuid4())" >> mep/local_settings.py | ||
|
||
|
||
- name: Run pytest | ||
run: py.test --cov=./ --cov-report=xml | ||
|
||
- name: Upload test coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
flags: python | ||
|
||
# Set the color of the slack message used in the next step based on the | ||
# status of the build: "warning" for failure and "good" for success | ||
- name: Set Slack message color based on build status | ||
if: ${{ always() }} | ||
env: | ||
JOB_STATUS: ${{ job.status }} | ||
run: echo "SLACK_COLOR=$(if [ "$JOB_STATUS" == "success" ]; then echo "good"; elif [ "$JOB_STATUS" == "failure" ]; then echo "danger"; else echo "warning"; fi)" >> $GITHUB_ENV | ||
|
||
# Send a message to slack to report the build status. The webhook is stored | ||
# at the organization level and available to all repositories. Only run on | ||
# scheduled builds & pushes, since PRs automatically report to Slack. | ||
- name: Report status to Slack | ||
uses: rtCamp/action-slack-notify@master | ||
if: ${{ always() && (github.event_name == 'schedule' || github.event_name == 'push') }} | ||
continue-on-error: true | ||
env: | ||
SLACK_COLOR: ${{ env.SLACK_COLOR }} | ||
SLACK_WEBHOOK: ${{ secrets.ACTIONS_SLACK_WEBHOOK }} | ||
SLACK_TITLE: "Run #${{ github.run_number }} for workflow `${{ github.workflow }}`: ${{ job.status }}" | ||
SLACK_MESSAGE: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run #${{ github.run_number }}> | <https://github.com/${{ github.repository }}/|${{ github.repository }}@${{ github.ref }}>" | ||
SLACK_FOOTER: "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|View commit>" | ||
MSG_MINIMAL: true # use compact slack message format | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.5.4 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ pytest-ordering | |
#pytest-sugar | ||
django-debug-toolbar | ||
sphinx | ||
wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome that this worked; maybe we could extract it to a shell script at some point