Build&Test Branch #1114
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
# | |
# Workflow: Build&Test Branch | |
# | |
# Builds the code and run tests on a 2-dimension matrix of OS and frameworks. | |
# | |
# Note: runs only on the hazelcast/hazelcast-csharp-client so that we do not pollute | |
# fork repositories with unwanted actions (our contributors may not want an action to | |
# run in their fork). | |
# | |
# Relies on build-and-test.yml workflow to do the actual building and testing of | |
# each OS and framework. Results are uploaded as artifacts and published as checks. | |
# | |
name: Build&Test Branch | |
on: | |
# trigger on schedule (default branch only) | |
schedule: | |
# everyday at 4:27 UTC | |
- cron: '27 4 * * *' | |
# trigger on push to any branch | |
push: | |
branches-ignore: | |
- 'release/*' | |
- 'wip/*' | |
tags-ignore: | |
- '*' | |
jobs: | |
# ensure we are running on the proper repository | |
ensure-repo: | |
name: Ensure Repository | |
runs-on: ubuntu-latest | |
if: github.repository == 'hazelcast/hazelcast-csharp-client' | |
steps: | |
- name: Report | |
shell: bash | |
run: echo "Repository is ${{ github.repository }}" | |
# get frameworks | |
get-fwks: | |
name: Get Frameworks | |
needs: ensure-repo | |
uses: ./.github/workflows/get-frameworks.yml | |
secrets: inherit | |
# build and test | |
build-test: | |
name: Build&Test / ${{ matrix.os }} | |
needs: get-fwks | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest ] | |
uses: ./.github/workflows/build-and-test.yml | |
secrets: inherit | |
with: | |
os: ${{ matrix.os }} | |
fwks: ${{ needs.get-fwks.outputs[format('fwks-{0}', matrix.os)] }} | |
# create the result check | |
report: | |
name: Build&Test Result | |
runs-on: ubuntu-latest | |
needs: [ "build-test", "ensure-repo" ] | |
if: always() && needs.ensure-repo.result == 'success' | |
steps: | |
- name: Report | |
shell: bash | |
run: | | |
if [ "${{ needs.build-test.result }}" == "success" ]; then | |
echo "All Build&Test checks completed successfully." | |
else | |
echo "At least one Build&Test check has failed." | |
echo "::error::At least one Build&Test check has failed." | |
exit 1 | |
fi | |
# create checks | |
create-checks: | |
name: Create Checks | |
needs: ["build-test","ensure-repo"] | |
if: always() && needs.ensure-repo.result == 'success' | |
uses: ./.github/workflows/create-checks.yml | |
secrets: inherit | |
with: | |
conclusion: ${{ needs.build-test.result }} | |
#run_id: ${{ github.run_id }} # run id | |
head_sha: ${{ github.sha }} # sha that triggered the workflow | |
coverage: true |