-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2990 from esl/gh-actions
Gh actions
- Loading branch information
Showing
5 changed files
with
172 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
# required for run_common_test.erl | ||
KEEP_COVER_RUNNING: '1' | ||
SKIP_AUTO_COMPILE: 'true' | ||
|
||
jobs: | ||
small_tests: | ||
name: small_tests on OTP ${{matrix.otp}} | ||
strategy: | ||
matrix: | ||
otp: ['23.0.3', '22.3'] | ||
runs-on: ubuntu-20.04 | ||
env: | ||
PRESET: 'small_tests' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ErlGang/[email protected] | ||
with: | ||
otp-version: ${{ matrix.otp }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/rebar3 | ||
key: rebar3-${{ hashFiles('rebar.lock') }} | ||
- name: create certificates | ||
run: make certs | ||
- name: run test | ||
run: | | ||
./rebar3 compile #required for coverage reporting | ||
tools/travis-test.sh -p $PRESET -s true -e true | ||
- name: report coverage | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cp _build/test/cover/*.coverdata /tmp | ||
./rebar3 coveralls send | ||
big_tests: | ||
name: ${{matrix.preset}} on OTP ${{matrix.otp}} | ||
strategy: | ||
matrix: | ||
preset: [internal_mnesia, pgsql_mnesia, mysql_redis, odbc_mssql_mnesia, | ||
ldap_mnesia, riak_mnesia, elasticsearch_and_cassandra_mnesia] | ||
otp: ['23.0.3'] | ||
runs-on: ubuntu-20.04 | ||
env: | ||
PRESET: ${{matrix.preset}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ErlGang/[email protected] | ||
with: | ||
otp-version: ${{matrix.otp}} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/rebar3 | ||
key: rebar3-${{ hashFiles('rebar.lock') }} | ||
- name: create certificates | ||
run: make certs | ||
- name: set required env variables for preset | ||
run: tools/gh-actions-configure-preset.sh "$PRESET" | ||
- if: ${{ matrix.preset == 'odbc_mssql_mnesia' }} | ||
run: sudo apt-get install -y tdsodbc | ||
- name: build releases | ||
run: | | ||
./rebar3 compile #required for coverage reporting | ||
tools/build-releases.sh | ||
- name: build big tests | ||
run: tools/travis-build-tests.sh | ||
- name: start backends | ||
run: tools/travis-setup-db.sh | ||
- name: run test | ||
run: tools/travis-test.sh -p $PRESET -s false -e false | ||
- name: report coverage | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./rebar3 coveralls send | ||
|
||
coveralls_webhook: | ||
needs: [big_tests, small_tests] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Finish coveralls parallel build | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
|
||
dialyzer: | ||
name: dialyzer on OTP ${{matrix.otp}} | ||
strategy: | ||
matrix: | ||
otp: [ '23.0.3'] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ErlGang/[email protected] | ||
with: | ||
otp-version: ${{matrix.otp}} | ||
- run: tools/travis-test.sh -p dialyzer_only | ||
|
||
pkg: | ||
name: ${{matrix.pkg}} package | ||
strategy: | ||
matrix: | ||
pkg: [centos_7, debian_stretch] | ||
runs-on: ubuntu-20.04 | ||
env: | ||
ESL_ERLANG_PKG_VER: "22.3.4.9-1" | ||
pkg_PLATFORM: ${{matrix.pkg}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: tools/travis-test.sh -p pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
## GITHUB_ENV=/dev/tty ./gh-actions-configure-preset.sh internal-mnesia | ||
|
||
DB_ARRAY=( $(./tools/test_runner/presets_to_dbs.sh "$1" ) ) | ||
[ "${#DB_ARRAY[@]}" -gt 0 ] && export DB="${DB_ARRAY[@]}" | ||
|
||
case "$1" in | ||
internal_mnesia) | ||
export REL_CONFIG="with-all" TLS_DIST=true ;; | ||
odbc_mssql_mnesia) | ||
export REL_CONFIG="with-odbc" ;; | ||
mysql_redis) | ||
export REL_CONFIG="with-mysql with-redis with-amqp_client" ;; | ||
pgsql_mnesia) | ||
export REL_CONFIG="with-pgsql" ;; | ||
riak_mnesia) | ||
export REL_CONFIG="with-riak" ;; | ||
ldap_mnesia) | ||
export REL_CONFIG="with-none" ;; | ||
elasticsearch_and_cassandra_mnesia) | ||
export REL_CONFIG="with-elasticsearch with-cassandra" TESTSPEC=mam.spec | ||
esac | ||
|
||
if [ ! -z "$GITHUB_ENV" ]; then | ||
env | egrep "^(DB|REL_CONFIG|TLS_DIST)=" >> $GITHUB_ENV | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters