Convert to GHA, fix tests, fix build #1
Workflow file for this run
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
name: KBase Groups tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
push: | |
# run workflow when merging to main or develop | |
branches: | |
- main | |
- master | |
- develop | |
jobs: | |
groups_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# the current production setup | |
- java: '8' | |
codecov: true | |
mongo: 'mongodb-linux-x86_64-3.6.13' | |
wired_tiger: 'false' | |
ant_test: 'test' | |
# test all code w/ java 11 | |
- java: '11' | |
codecov: true | |
mongo: 'mongodb-linux-x86_64-3.6.13' | |
wired_tiger: 'false' | |
ant_test: 'test' | |
# test the latest 3X version of mongo against just the mongo storage code | |
- java: '11' | |
mongo: 'mongodb-linux-x86_64-3.6.23' | |
wired_tiger: 'true' | |
ant_test: 'test_mongo_storage' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{matrix.java}} | |
- name: Install dependencies and set up test config | |
shell: bash | |
run: | | |
export HOMEDIR=`pwd` | |
# move to parent dir of homedir to install binaries etc | |
cd .. | |
# set up jars | |
git clone https://github.com/kbase/jars | |
export JARSDIR=$(pwd)/jars/lib/jars/ | |
# set up mongo | |
wget -q http://fastdl.mongodb.org/linux/${{matrix.mongo}}.tgz | |
tar xfz ${{matrix.mongo}}.tgz | |
export MONGOD=`pwd`/${{matrix.mongo}}/bin/mongod | |
# set up test config | |
cd $HOMEDIR | |
cp -n test.cfg.example test.cfg | |
sed -i "s#^test.jars.dir.*#test.jars.dir=$JARSDIR#" test.cfg | |
sed -i "s#^test.temp.dir =.*#test.temp.dir=temp_test_dir#" test.cfg | |
sed -i "s#^test.mongo.exe.*#test.mongo.exe=$MONGOD#" test.cfg | |
sed -i "s#^test.mongo.useWiredTiger.*#test.mongo.useWiredTiger=${{matrix.wired_tiger}}#" test.cfg | |
cat test.cfg | |
- name: Run tests | |
shell: bash | |
run: | | |
ant ${{matrix.ant_test}} | |
- name: Upload coverage to Codecov | |
if: matrix.include.codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |