Skip to content

Commit

Permalink
Update: Run tests on commits
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Nov 3, 2020
1 parent ab725f5 commit 6c6a587
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ jobs:
uses: actions/checkout@v2
- name: Get release version
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
- name: Run unit tests
run: ./unit-tests.sh
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Run integration tests
run: ./integration-tests.sh
- name: Build master
env:
DOCKER_USERNAME: 'boky'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run unit tests
run: ./unit-tests.sh
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Run integration tests
run: ./integration-tests.sh
- name: Run Buildx
env:
PLATFORMS: "linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le"
Expand Down
7 changes: 7 additions & 0 deletions integration-test.sh → integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ set -e
cd integration-tests

run_test() {
local exit_code
echo
echo
echo "☆☆☆☆☆☆☆☆☆☆ $1 ☆☆☆☆☆☆☆☆☆☆"
echo
(
cd "$1"
set +e
docker-compose up --build --abort-on-container-exit --exit-code-from tests
exit_code="$?"
docker-compose down
if [[ "$exit_code" != 0 ]]; then
exit "$exit_code"
fi
set -e
)
}

Expand Down

0 comments on commit 6c6a587

Please sign in to comment.