Unit Tests #101
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: Unit Tests | |
on: | |
push: | |
pull_request: | |
branches: | |
master | |
schedule: | |
- cron: "15 5 19 * *" #run job on the 19th day of every month on the 15th minute of the 5th hour | |
jobs: | |
build: | |
runs-on: ubuntu-18.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
gs_version: [ 2.4.8, 3.1.0.6, 3.2.17, 3.3.9, 3.4.5, 3.5.8, 3.6.3 ] | |
test: [ UnitTests, BasicA, BasicB ] | |
allowfailure: [false] | |
exclude: | |
# exclude failing jobs | |
- gs_version: 2.4.8 | |
test: UnitTests | |
allowfailure: false | |
- gs_version: 2.4.8 | |
test: BasicB | |
allowfailure: false | |
- gs_version: 3.2.17 | |
test: UnitTests | |
allowfailure: false | |
include: | |
# re-include failing jobs as 'allowed to fail' | |
- gs_version: 2.4.8 | |
test: UnitTests | |
allowfailure: true | |
- gs_version: 2.4.8 | |
test: BasicB | |
allowfailure: true | |
- gs_version: 3.2.17 | |
test: UnitTests | |
allowfailure: true | |
# specific tests | |
- gs_version: 3.3.4.3 | |
test: Error | |
allowfailure: false | |
- gs_version: 3.4.5 | |
test: Install | |
allowfailure: false | |
- gs_version: 3.5.5 | |
test: Upgrade_71 | |
allowfailure: false | |
env: | |
GS_VERSION: ${{ matrix.gs_version }} | |
TEST: ${{ matrix.test }} | |
continue-on-error: ${{ matrix.allowfailure }} | |
name: ${{ matrix.gs_version }} - ${{ matrix.test }} | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" | |
- name: Log date | |
run: echo "${{ steps.date.outputs.date }}" | |
- name: Set default run status | |
run: echo "::set-output name=last_run_status::default" > last_run_status | |
- name: Restore last run status | |
id: last_run | |
uses: actions/cache@v2 | |
with: | |
path: | | |
last_run_status | |
key: ${{ github.run_id }}-${{ matrix.gs_version }}-${{ matrix.test }}-${{ steps.date.outputs.date }} | |
restore-keys: | | |
${{ github.run_id }}-${{ matrix.gs_version }}-${{ matrix.test }}- | |
- name: Set last run status | |
id: last_run_status | |
run: cat last_run_status | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.workflow_dispatch.ref }} | |
- name: Run tests | |
id: test_run | |
if: steps.last_run_status.outputs.last_run_status != 'success' | |
run: | | |
export GS_HOME="$(pwd)" | |
export PATH=$GS_HOME/bin:$PATH | |
export GS_TRAVIS=true | |
hostname | |
cat /etc/hosts | |
$GITHUB_WORKSPACE/tests/testTravisCI.sh | |
shell: bash | |
- name: Save run status | |
if: steps.last_run_status.outputs.last_run_status != 'success' | |
run: echo "::set-output name=last_run_status::${{ steps.test_run.outcome }}" > last_run_status | |
slack-workflow-status: | |
if: always() | |
name: Post Workflow Status To Slack | |
needs: | |
- build | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Slack Workflow Notification | |
uses: Gamesight/slack-workflow-status@master | |
with: | |
repo_token: ${{secrets.GITHUB_TOKEN}} | |
slack_webhook_url: ${{secrets.SLACK_DALEHENRICH}} | |
name: 'action run' |