Skip to content

Commit

Permalink
Test changes in mix independently
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Jan 13, 2022
1 parent 861cb9b commit d414512
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/test-mix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test Mix

on:
push:
paths-ignore:
- '**.md'
- '**.bat'
- 'ecs/**'
pull_request:
paths-ignore:
- '**.md'
- '**.bat'
- 'ecs/**'

jobs:
build-mix:
name: Build Mix
runs-on: ubuntu-20.04
strategy:
fail-fast: true
max-parallel: 1

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build mix image
run: |
(cd mix && docker build -t ejabberd/mix .)
- name: Build ecs image
run: |
cd ecs
./build.sh latest
- name: Run ecs image
run: |
docker images
docker run --name ejabberd -d -p 5222:5222 ejabberd/ecs:latest
- name: Wait ejabberd started
run: |
docker exec ejabberd bin/ejabberdctl started
- name: Check ecs results
run: |
docker ps -s
docker logs ejabberd
docker logs ejabberd | grep -q "Start accepting TCP connections" || exit 1
docker logs ejabberd | grep -q "error" && exit 1 || exit 0
docker logs ejabberd | grep -q "Error" && exit 1 || exit 0
- name: Save image
run: |
docker image save ejabberd/ecs:latest --output ejabberd-latest.tar
- name: Upload image
uses: actions/upload-artifact@v2
with:
name: ejabberd-image
path: ejabberd-latest.tar

- run: |
echo "::notice::To get this image, download ejabberd-image.zip, "\
"uncompress it and run: " \
"docker image load -i ejabberd-latest.tar"
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
paths-ignore:
- '**.md'
- '**.bat'
- 'mix/**'
pull_request:
paths-ignore:
- '**.md'
- '**.bat'
- 'mix/**'

jobs:
build:
Expand Down

0 comments on commit d414512

Please sign in to comment.