Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

github action that runs docker-compose #7456

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e11004b
github action that runs docker-compose
peterbe Aug 25, 2020
6b5c5b2
indentation
peterbe Aug 25, 2020
893ec73
rearrange things
peterbe Aug 26, 2020
f5f3d0b
indentation
peterbe Aug 26, 2020
bffc8f8
try this
peterbe Aug 26, 2020
e3c597a
Merge branch 'master' into github-action-that-runs-docker-compose
peterbe Aug 26, 2020
0cc2605
not shared
peterbe Aug 26, 2020
a617d9b
debugging
peterbe Aug 26, 2020
731b5b9
debugging
peterbe Aug 26, 2020
b684fa5
check why things are down
peterbe Aug 26, 2020
373318f
don't forget to run minio_setup
peterbe Aug 26, 2020
a7ea221
start kumascript too
peterbe Aug 26, 2020
ac32d28
final debugging
peterbe Aug 26, 2020
317c438
unbreak docs
peterbe Aug 26, 2020
2cd461c
cleanup
peterbe Aug 26, 2020
d52c2a0
hacking
peterbe Sep 2, 2020
9de5e77
remove 'make' and go straight to yarn
peterbe Sep 2, 2020
072d1eb
have docker-compose build as a separate step for clarity
peterbe Sep 2, 2020
585b5a0
use docker-build-with-cache-action
peterbe Sep 2, 2020
ede6452
trying action-docker-layer-caching
peterbe Sep 2, 2020
71722f5
using a tagged release of action-docker-layer-caching
peterbe Sep 2, 2020
c681a7e
comment
peterbe Sep 2, 2020
3a59487
trying docker.pkg.github.com with docker-build-with-cache-action
peterbe Sep 2, 2020
c03b6ad
dockerfile path
peterbe Sep 2, 2020
f79376b
small adjustments
peterbe Sep 2, 2020
236aeb1
push_image_and_stages: false
peterbe Sep 3, 2020
6fc2d11
Merge branch 'master' into github-action-that-runs-docker-compose
peterbe Sep 8, 2020
be8c400
no username
peterbe Sep 8, 2020
0a0afb5
use peterbe
peterbe Sep 8, 2020
78acdce
more comments
peterbe Sep 8, 2020
491aabe
try username 'mdn'
peterbe Sep 8, 2020
3557ece
changing back to 'peterbe'
peterbe Sep 8, 2020
394cdf4
conditional on:push
peterbe Sep 8, 2020
1c41308
comment out test on stages
peterbe Sep 8, 2020
32f241b
tiny edit to trigger new build
peterbe Sep 8, 2020
a2a2131
yml fix
peterbe Sep 8, 2020
2293848
test
peterbe Sep 8, 2020
0a2f886
docker pull
peterbe Sep 8, 2020
ebd97fa
docker pull 2
peterbe Sep 8, 2020
2ab9a78
pull from ghcr.io instead
peterbe Sep 8, 2020
d01d584
Merge branch 'master' into github-action-that-runs-docker-compose
peterbe Dec 9, 2020
eafc965
don't try to get fancy with docker caching (yet)
peterbe Dec 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docker testing

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
env:
UID: 0

steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Environment info
run: |
docker-compose --version

- name: Build docker
run: docker-compose build

- name: Compile locales
run: docker-compose run testing make localecompile

- name: Build static
run: docker-compose run testing make build-static

- name: DB migrations
run: |
docker-compose run testing ./manage.py migrate
# Essentially compares **/models.py with **/migrations/*.py and
# makes sure the developer didn't forget to create a new migration.
docker-compose run testing ./manage.py makemigrations --check --dry-run

- name: Run Python tests
run: |
# TODO: Run the `make coveragetest` only if it's a pull request.
# We might be able to use something
# like `if [ ${{ github.head_ref}} eq 'master']` but not sure.
# Slower...
docker-compose run testing make coveragetest
# Faster...
#docker-compose run testing make test

- name: Submit code coverage
run: |
bash <(curl -s --retry 3 --retry-connrefused https://codecov.io/bash)

- name: Run JavaScript tests
run: |
docker-compose run testing yarn test-ci

- name: Run localerefresh
run: |
set -e
docker-compose run testing make localeextract
docker-compose run testing make localetest
docker-compose run testing make localecompile

cd locale
export GIT_PAGER=cat
git diff -G "^msgid " templates/LC_MESSAGES
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps are:
3. Make your changes, and create one or more commits.
4. Push your branch to your fork.
5. Open a pull request (PR).
6. Fix any issues identified by [TravisCI][travisci], our automated testing
6. Fix any issues identified by [GitHub Actions][githubactions], our automated testing
provider.
7. Fix any issues identified by code review.

Expand All @@ -48,7 +48,7 @@ and give feedback, or to tell you when we plan to review it.

[gh-flow]: https://guides.github.com/introduction/flow/
[install]: https://kuma.readthedocs.io/en/latest/installation.html
[travisci]: https://travis-ci.com/mdn/kuma/pull_requests
[githubactions]: https://github.com/mdn/kuma/actions

Conventions
===========
Expand Down Expand Up @@ -171,8 +171,8 @@ MDN uses automated tests to prevent regressions and ensure that new code does
what it claims. Tests are required for new functionality, as measured by code
coverage tools, and all tests must pass before merging.

We use [TravisCI][travisci] to automatically run tests and quality checks when
a pull request is opened. If TravisCI identifies problems, we expect them to
We use [GitHub Actions][githubactions] to automatically run tests and quality checks when
a pull request is opened. If GitHub Actions identifies problems, we expect them to
be fixed before the code review starts.

It is a good idea to run the tests that apply to your change before opening a
Expand All @@ -197,7 +197,7 @@ We **prefer** test functions, a small number of global
that customize the global fixtures, and using [assert][assert] for test
assertions.

[travisci]: https://travis-ci.com/mdn/kuma/pull_requests
[githubactions]: https://travis-ci.com/mdn/kuma/pull_requests
[testing]: https://kuma.readthedocs.io/en/latest/tests.html#running-the-test-suite
[testcase]: https://docs.djangoproject.com/en/1.8/topics/testing/tools/#testcase
[fixture_files]: https://docs.djangoproject.com/en/1.8/topics/testing/tools/#fixture-loading
Expand Down
15 changes: 4 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Kuma
====

.. image:: https://travis-ci.com/mdn/kuma.svg?branch=master
:target: https://travis-ci.com/mdn/kuma
:alt: Build Status
.. image:: https://github.com/mdn/kuma/workflows/Docker%20Testing/badge.svg
:target: https://github.com/mdn/kuma/actions?query=workflow%3A%22Docker+Testing%22
:alt: Python Lints

.. image:: https://github.com/mdn/kuma/workflows/Python%20Lints/badge.svg
:target: https://github.com/mdn/kuma/actions?query=workflow%3A%22Python+Lints%22
Expand Down Expand Up @@ -39,15 +39,11 @@ Development
===========

:Code: https://github.com/mdn/kuma
:Issues: `P1 Bugs`_ (to be fixed in current or next sprint_)
:Issues: `P1 Bugs`_ (to be fixed ASAP)

`P2 Bugs`_ (to be fixed in 180 days)

`All developer.mozilla.org bugs`_

`Pull Request Queues`_
:Dev Docs: https://kuma.readthedocs.io/en/latest/installation.html
:CI Server: https://travis-ci.com/mdn/kuma
:Forum: https://discourse.mozilla.org/c/mdn
:Matrix: `#mdn room`_
:Servers: `What's Deployed on MDN?`_
Expand All @@ -58,10 +54,7 @@ Development

.. _`P1 Bugs`: https://github.com/mdn/kuma/issues?q=is%3Aopen+is%3Aissue+label%3Ap1
.. _`P2 Bugs`: https://github.com/mdn/kuma/issues?q=is%3Aopen+is%3Aissue+label%3Ap2
.. _`All developer.mozilla.org bugs`: https://mzl.la/2onLvZ8
.. _`Pull Request Queues`: http://prs.mozilla.io/mdn:kuma,kumascript,infra,mdn-fiori
.. _`What's Deployed on MDN?`: https://whatsdeployed.io/s/HC0/mdn/kuma
.. _sprint: https://wiki.mozilla.org/Engagement/MDN_Durable_Team/Processes#Planning_Sprints
.. _`#mdn room`: https://chat.mozilla.org/#/room/#mdn:mozilla.org


Expand Down
2 changes: 1 addition & 1 deletion contribute.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": {
"url": "https://github.com/mdn/kuma",
"license": "MPL-2.0",
"tests": "https://travis-ci.com/mdn/kuma"
"tests": "https://github.com/mdn/kuma/actions"
},
"participate": {
"home": "https://wiki.mozilla.org/MDN",
Expand Down
20 changes: 19 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: '2.1'
services:
worker: &worker
image: mdnwebdocs/kuma_base
build:
context: .
dockerfile: docker/images/kuma_base/Dockerfile
command: ./scripts/start-worker
user: ${UID:-1000}
volumes:
Expand Down Expand Up @@ -70,6 +72,22 @@ services:
ports:
- "8000:8000"

# Used for ci testing
testing:
<<: *worker
command: bash
depends_on:
- mysql
- elasticsearch
- redis
- ssr
- kumascript
- minio
- minio_setup
volumes:
- ./:/app


# ssr is a Node server that performs server-side rendering of our React UI
ssr:
<<: *worker
Expand Down
2 changes: 1 addition & 1 deletion docs/assets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ The ``staticfiles`` app is configured by Django settings:
which avoids combining files when collecting them.
* Production server (``DEBUG=False``): kuma.core.pipeline.storage.ManifestPipelineStorage_,
which combines packaged files, hashes the names, and creates a manifest.
* Testing (``pytest``, TravisCI, etc.) and ``make`` commands: pipeline.storage.PipelineStorage_,
* Testing (``pytest`` etc.) and ``make`` commands: pipeline.storage.PipelineStorage_,
which combines packaged files but does not hash the names.

.. _django.contrib.staticfiles: cs.djangoproject.com/en/1.11/ref/contrib/staticfiles/
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Before deploying, a staff member should:

.. _Dennis: https://github.com/willkg/dennis
.. _Jenkins: https://ci.us-west-2.mdn.mozit.cloud
.. _Kuma: https://travis-ci.com/mdn/kuma/
.. _Kuma: https://github.com/mdn/kuma/actions
.. _KumaScript: https://travis-ci.org/mdn/kumascript
.. _Pontoon: https://pontoon.mozilla.org/projects/mdn/
.. _`Kuma images`: https://hub.docker.com/r/mdnwebdocs/kuma/tags/
Expand Down