Cleanup v15 #2951
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: Tests & Code Coverage | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
should_run_unit_tests: | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
with: | |
cancel_others: "true" # workflow-runs from outdated commits will be cancelled. | |
concurrent_skipping: "same_content" | |
skip_after_successful_duplicate: "true" | |
paths: '["**/*.go", "**/*.mod", "**/*.sum"]' | |
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | |
- name: Skipping test | |
run: echo Should I skip tests? ${{ steps.skip_check.outputs.should_skip }} | |
unit_tests: | |
needs: should_run_unit_tests | |
if: ${{ needs.should_run_test.outputs.should_skip != 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Setup Golang | |
uses: actions/[email protected] | |
with: | |
go-version: 1.19 | |
# - name: Get data from build cache | |
# uses: actions/cache@v2 | |
# with: | |
# # In order: | |
# # * Module download cache | |
# # * Build cache (Linux) | |
# # * Build cache (Mac) | |
# # * Build cache (Windows) | |
# path: | | |
# ~/go/pkg/mod | |
# ~/.cache/go-build | |
# ~/Library/Caches/go-build | |
# ~\AppData\Local\go-build | |
# key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | |
# restore-keys: | | |
# ${{ runner.os }}-go-${{ matrix.go-version }}- | |
- name: Run all unit tests | |
run: make test-unit |