ci: try to prepare a compiled test profile for test jobs
This commit is contained in:
parent
a13b146499
commit
3bcd76a681
|
@ -14,73 +14,77 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
eunit_and_proper:
|
prepare:
|
||||||
strategy:
|
runs-on: ubuntu-20.04
|
||||||
matrix:
|
# prepare source with any OTP version, no need for a matrix
|
||||||
otp:
|
container: "ghcr.io/emqx/emqx-builder/5.0-14:1.13.3-24.2.1-1-ubuntu20.04"
|
||||||
- 24.2.1-1
|
outputs:
|
||||||
elixir:
|
fast_ct_apps: ${{ steps.run_find_apps.outputs.fast_ct_apps }}
|
||||||
- 1.13.3
|
docker_ct_apps: ${{ steps.run_find_apps.outputs.docker_ct_apps }}
|
||||||
os:
|
|
||||||
- ubuntu20.04
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
|
|
||||||
runs-on: aws-amd64
|
|
||||||
container: "emqx/emqx-builder/5.0-14:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Get deps git refs for cache
|
|
||||||
id: deps-refs
|
|
||||||
run: |
|
|
||||||
scripts/get-dep-refs.sh
|
|
||||||
make clean-all
|
|
||||||
- name: load quicer cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: source/_build/default/lib/quicer/
|
path: source
|
||||||
key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
|
fetch-depth: 0
|
||||||
|
- name: find_ct_apps
|
||||||
|
working-directory: source
|
||||||
|
id: run_find_apps
|
||||||
|
run: |
|
||||||
|
fast_ct_apps="$(./scripts/find-apps.sh --ct fast --json)"
|
||||||
|
docker_ct_apps="$(./scripts/find-apps.sh --ct docker --json)"
|
||||||
|
echo "fast-ct-apps: $fast_ct_apps"
|
||||||
|
echo "docer-ct-apps: $docker_ct_apps"
|
||||||
|
echo "::set-output name=fast_ct_apps::$fast_ct_apps"
|
||||||
|
echo "::set-output name=docker_ct_apps::$docker_ct_apps"
|
||||||
|
- name: get_all_deps
|
||||||
|
working-directory: source
|
||||||
|
run: |
|
||||||
|
make deps-all
|
||||||
|
./rebar3 as test compile
|
||||||
|
cd ..
|
||||||
|
zip -ryq source.zip source/* source/.[^.]*
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: source
|
||||||
|
path: source.zip
|
||||||
|
|
||||||
|
eunit_and_proper:
|
||||||
|
needs: prepare
|
||||||
|
runs-on: aws-amd64
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
container: "ghcr.io/emqx/emqx-builder/5.0-14:1.13.3-24.2.1-1-ubuntu20.04"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: AutoModality/action-clean@v1
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: source
|
||||||
|
path: .
|
||||||
|
- name: unzip source code
|
||||||
|
run: unzip -o -q source.zip
|
||||||
# produces eunit.coverdata
|
# produces eunit.coverdata
|
||||||
- name: eunit
|
- name: eunit
|
||||||
|
working-directory: source
|
||||||
run: make eunit
|
run: make eunit
|
||||||
|
|
||||||
# produces proper.coverdata
|
# produces proper.coverdata
|
||||||
- name: proper
|
- name: proper
|
||||||
|
working-directory: source
|
||||||
run: make proper
|
run: make proper
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: coverdata
|
name: coverdata
|
||||||
path: _build/test/cover
|
path: source/_build/test/cover
|
||||||
|
|
||||||
find_apps:
|
|
||||||
runs-on: aws-amd64
|
|
||||||
container: emqx/emqx-builder/5.0-14:1.13.3-24.2.1-1-ubuntu20.04
|
|
||||||
outputs:
|
|
||||||
fast_ct_apps: ${{ steps.run_find_apps.outputs.fast_ct_apps }}
|
|
||||||
docker_ct_apps: ${{ steps.run_find_apps.outputs.docker_ct_apps }}
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: find apps
|
|
||||||
id: run_find_apps
|
|
||||||
run: |
|
|
||||||
fast_ct_apps="$(./scripts/find-apps.sh --ct fast --json)"
|
|
||||||
docker_ct_apps="$(./scripts/find-apps.sh --ct docker --json)"
|
|
||||||
echo "::set-output name=fast_ct_apps::$fast_ct_apps"
|
|
||||||
echo "::set-output name=docker_ct_apps::$docker_ct_apps"
|
|
||||||
|
|
||||||
ct_docker:
|
ct_docker:
|
||||||
needs: find_apps
|
needs: prepare
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
app_name: ${{ fromJson(needs.find_apps.outputs.docker_ct_apps) }}
|
app_name: ${{ fromJson(needs.prepare.outputs.docker_ct_apps) }}
|
||||||
otp_release:
|
otp_release:
|
||||||
- "erlang24"
|
- "erlang24"
|
||||||
|
|
||||||
|
@ -90,8 +94,15 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: AutoModality/action-clean@v1
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: source
|
||||||
|
path: .
|
||||||
|
- name: unzip source code
|
||||||
|
run: unzip -q source.zip
|
||||||
- name: docker compose up
|
- name: docker compose up
|
||||||
|
working-directory: source
|
||||||
env:
|
env:
|
||||||
MONGO_TAG: 5
|
MONGO_TAG: 5
|
||||||
MYSQL_TAG: 8
|
MYSQL_TAG: 8
|
||||||
|
@ -112,98 +123,85 @@ jobs:
|
||||||
|
|
||||||
# produces <app-name>.coverdata
|
# produces <app-name>.coverdata
|
||||||
- name: run common test
|
- name: run common test
|
||||||
|
working-directory: source
|
||||||
run: |
|
run: |
|
||||||
docker exec -i ${{ matrix.otp_release }} bash -c "git config --global --add safe.directory \"$GITHUB_WORKSPACE\" && make ${{ matrix.app_name }}-ct"
|
docker exec -i ${{ matrix.otp_release }} bash -c "git config --global --add safe.directory \"$GITHUB_WORKSPACE\" && make ${{ matrix.app_name }}-ct"
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: matrix.otp_release == 'erlang24'
|
if: matrix.otp_release == 'erlang24'
|
||||||
with:
|
with:
|
||||||
name: coverdata
|
name: coverdata
|
||||||
path: _build/test/cover
|
path: source/_build/test/cover
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: logs_${{ matrix.otp_release }}
|
name: logs_${{ matrix.otp_release }}
|
||||||
path: _build/test/logs
|
path: source/_build/test/logs
|
||||||
|
|
||||||
ct:
|
ct:
|
||||||
needs: find_apps
|
needs: prepare
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
app_name: ${{ fromJson(needs.find_apps.outputs.fast_ct_apps) }}
|
app_name: ${{ fromJson(needs.prepare.outputs.fast_ct_apps) }}
|
||||||
otp:
|
|
||||||
- 24.2.1-1
|
|
||||||
elixir:
|
|
||||||
- 1.13.3
|
|
||||||
os:
|
|
||||||
- ubuntu20.04
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
runs-on: aws-amd64
|
runs-on: aws-amd64
|
||||||
container: "emqx/emqx-builder/5.0-14:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
|
container: "ghcr.io/emqx/emqx-builder/5.0-14:1.13.3-24.2.1-1-ubuntu20.04"
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: AutoModality/action-clean@v1
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: source
|
||||||
|
path: .
|
||||||
|
- name: unzip source code
|
||||||
|
run: unzip -q source.zip
|
||||||
|
|
||||||
# produces <app-name>.coverdata
|
# produces <app-name>.coverdata
|
||||||
- name: run common test
|
- name: run common test
|
||||||
|
working-directory: source
|
||||||
run: |
|
run: |
|
||||||
make ${{ matrix.app_name }}-ct
|
make ${{ matrix.app_name }}-ct
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: matrix.otp == '24.2.1-1'
|
if: matrix.otp == '24.2.1-1'
|
||||||
with:
|
with:
|
||||||
name: coverdata
|
name: coverdata
|
||||||
path: _build/test/cover
|
path: source/_build/test/cover
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: logs_${{ matrix.otp_release }}
|
name: logs_${{ matrix.otp_release }}
|
||||||
path: _build/test/logs
|
path: source/_build/test/logs
|
||||||
|
|
||||||
make_cover:
|
make_cover:
|
||||||
needs:
|
needs:
|
||||||
- eunit_and_proper
|
- eunit_and_proper
|
||||||
- ct
|
- ct
|
||||||
- ct_docker
|
- ct_docker
|
||||||
strategy:
|
runs-on: ubuntu-20.04
|
||||||
matrix:
|
container: "ghcr.io/emqx/emqx-builder/5.0-14:1.13.3-24.2.1-1-ubuntu20.04"
|
||||||
otp:
|
|
||||||
- 24.2.1-1
|
|
||||||
elixir:
|
|
||||||
- 1.13.3
|
|
||||||
os:
|
|
||||||
- ubuntu20.04
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
|
|
||||||
runs-on: aws-amd64
|
|
||||||
container: "emqx/emqx-builder/5.0-14:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: AutoModality/action-clean@v1
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
- name: Get deps git refs for cache
|
|
||||||
id: deps-refs
|
|
||||||
run: |
|
|
||||||
scripts/get-dep-refs.sh
|
|
||||||
make clean-all
|
|
||||||
- name: load quicer cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
with:
|
||||||
path: source/_build/default/lib/quicer/
|
name: source
|
||||||
key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
|
path: .
|
||||||
|
- name: unzip source code
|
||||||
|
run: unzip -q source.zip
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
name: download coverdata
|
name: download coverdata
|
||||||
with:
|
with:
|
||||||
name: coverdata
|
name: coverdata
|
||||||
path: _build/test/cover
|
path: source/_build/test/cover
|
||||||
|
|
||||||
- name: make cover
|
- name: make cover
|
||||||
|
working-directory: source
|
||||||
run: make cover
|
run: make cover
|
||||||
|
|
||||||
- name: send to coveralls
|
- name: send to coveralls
|
||||||
|
working-directory: source
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: make coveralls
|
run: make coveralls
|
||||||
|
@ -211,7 +209,7 @@ jobs:
|
||||||
# do this in a separate job
|
# do this in a separate job
|
||||||
upload_coverdata:
|
upload_coverdata:
|
||||||
needs: make_cover
|
needs: make_cover
|
||||||
runs-on: aws-amd64
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Coveralls Finished
|
- name: Coveralls Finished
|
||||||
env:
|
env:
|
||||||
|
|
Loading…
Reference in New Issue