Test updates #2880 #1726
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: MERIT build | |
on: | |
push: | |
branches: | |
- githubactions | |
- dev | |
- master | |
- feature/** | |
- hotfix/** | |
- release/** | |
env: | |
TZ: Australia/Canberra | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Install nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: npm config set //npm.pkg.github.com/:_authToken $NODE_AUTH_TOKEN | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm install | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1.0.6 | |
- name: Install and start elasticsearch | |
run: | | |
curl https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.3-amd64.deb -o elasticsearch.deb | |
sudo dpkg -i --force-confnew elasticsearch.deb | |
sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch | |
sudo sh -c 'echo ES_JAVA_OPTS=\"-Xmx1g -Xms1g\" >> /etc/default/elasticsearch' | |
sudo service elasticsearch restart | |
- name: Setup required MERIT folders | |
run: | | |
sudo mkdir -p /data/fieldcapture/cache | |
sudo chmod o+xw /data | |
sudo chmod o+xw /data/fieldcapture | |
sudo chmod o+xw /data/fieldcapture/cache | |
- name: Install and start mongodb | |
uses: supercharge/mongodb-github-action@1.7.0 | |
with: | |
mongodb-version: '5.0' | |
- name: Build and run jacoco coverage report with Gradle | |
uses: gradle/gradle-build-action@v2.4.2 | |
with: | |
arguments: test | |
env: | |
GPR_USER: ${{env.GITHUB_ACTOR}} | |
GPR_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Install javascript packages using the gradle clientInstall plugin | |
uses: gradle/gradle-build-action@v2.4.2 | |
with: | |
arguments: clientInstall | |
env: | |
GPR_USER: ${{env.GITHUB_ACTOR}} | |
GPR_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Run javascript unit tests | |
run: node_modules/karma/bin/karma start karma.conf.js --single-run --browsers ChromeHeadless | |
- name: Run MERIT functional tests | |
run: ./src/main/scripts/runFunctionalTests.sh | |
env: | |
GPR_USER: ${{env.GITHUB_ACTOR}} | |
GPR_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Clean to remove clover instrumentation | |
uses: gradle/gradle-build-action@v2.4.2 | |
with: | |
arguments: clean | |
env: | |
GPR_USER: ${{env.GITHUB_ACTOR}} | |
GPR_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Read the MERIT version from the gradle.properties file | |
id: read_property | |
uses: christian-draeger/read-properties@1.1.0 | |
with: | |
path: './gradle.properties' | |
properties: 'meritVersion' | |
- uses: castlabs/get-package-version-id-action@v2.0 | |
id: versions | |
with: | |
version: ${{steps.read_property.outputs.meritVersion}} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/delete-package-versions@v2 | |
if: ${{ steps.versions.outputs.ids != '' }} | |
with: | |
package-version-ids: "${{ steps.versions.outputs.ids }}" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish the JAR to the repository | |
uses: gradle/gradle-build-action@v2.4.2 | |
with: | |
arguments: publish | |
env: | |
GPR_USER: ${{env.GITHUB_ACTOR}} | |
GPR_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |