-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (46 loc) · 1.61 KB
/
test.yml
File metadata and controls
60 lines (46 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Test
on: push
env:
COMPOSE_FILE: docker-compose.test.yml
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
DOCKER_IMAGE: ${{ github.repository }}
DOCKER_REGISTRY: ghcr.io
DOCKER_USERNAME: ${{ github.repository_owner }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Branch Tag Action
uses: nimblehq/branch-tag-action@v1.2
- name: Docker login to docker container registry
run: "echo $DOCKER_TOKEN | docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin"
- name: Docker pull
if: env.BRANCH_TAG != 'latest' && env.BRANCH_TAG != 'development'
run: |
echo Pulling built image for the branch
docker-compose pull test || true
- name: Docker build
run: |
bin/docker-prepare
docker-compose build
docker-compose push test
tests:
name: Tests
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Branch Tag Action
uses: nimblehq/branch-tag-action@v1.2
- name: Docker login to docker container registry
run: "echo $DOCKER_TOKEN | docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME --password-stdin"
- name: Docker pull
run: docker-compose pull
- name: Linters
run: docker-compose run test yarn lint
- name: Unit tests
run: docker-compose run test bundle exec rspec --exclude-pattern "spec/systems/**/*_spec.rb" --profile
- name: System tests
run: docker-compose run test bundle exec rspec spec/systems --profile