Skip to content

Commit

Permalink
Merge pull request #1488 from mozmeao/test-in-github
Browse files Browse the repository at this point in the history
Test using GitHub Actions.
  • Loading branch information
glogiotatidis committed Dec 8, 2020
2 parents 16fc02b + 20d7b5e commit 8142a97
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
File renamed without changes.
20 changes: 20 additions & 0 deletions .github/workflows/pull-request-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test Pull Request

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: mozmeao/checkout@v1
- name: Docker pull
run: CI_COMMIT_SHORT_SHA=latest make pull
- name: Docker build
run: make build
- name: Lint
run: make lint
- name: Check migrations
run: make check-migrations
- name: Test
run: make test
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ build-image-django:
- mozmeao
script:
- CI_COMMIT_SHORT_SHA=latest make pull app=web
- CI_COMMIT_SHORT_SHA=latest make pull app=builder
- make build app=web
- make push app=web
# With latest tag for caching
- CI_COMMIT_SHORT_SHA=latest make build app=web
- CI_COMMIT_SHORT_SHA=latest make push app=web
- CI_COMMIT_SHORT_SHA=latest make build app=builder
- CI_COMMIT_SHORT_SHA=latest make push app=builder

build-image-redirector:
stage: build
tags:
- mozmeao
script:
- CI_COMMIT_SHORT_SHA=latest make pull app=web
- CI_COMMIT_SHORT_SHA=latest make pull app=redirector
- make build app=redirector
- make push app=redirector
# With latest tag for caching
Expand Down
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,23 @@ services:
- POSTGRES_PASSWORD=snippets
- POSTGRES_USER=snippets
- POSTGRES_DB=snippets

builder:
build:
context: .
target: builder
cache_from:
- mozmeao/snippets:builder-latest
args:
GIT_SHA: "${CI_COMMIT_SHA:-HEAD}"
image: "mozmeao/snippets:builder-${CI_COMMIT_SHORT_SHA:-latest}"

web:
build:
context: .
cache_from:
- mozmeao/snippets:builder-latest
- mozmeao/snippets:latest
args:
GIT_SHA: "${CI_COMMIT_SHA:-HEAD}"
image: "mozmeao/snippets:${CI_COMMIT_SHORT_SHA:-latest}"
Expand All @@ -25,6 +39,8 @@ services:
redirector:
build:
context: ./redirector
cache_from:
- mozmeao/snippets:redirector-latest
args:
GIT_SHA: "${CI_COMMIT_SHA:-HEAD}"
image: "mozmeao/snippets:redirector-${CI_COMMIT_SHORT_SHA:-latest}"
Expand Down

0 comments on commit 8142a97

Please sign in to comment.