Skip to content

add gh action workflow to mirror circle ci #13

add gh action workflow to mirror circle ci

add gh action workflow to mirror circle ci #13

Workflow file for this run

name: Test and Generate Docs
on: pull_request
jobs:
go-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: go.mod
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y git python3-pip
go install github.com/jstemmer/go-junit-report@v1.0.0
go install github.com/kyoh86/richgo@v0.3.10
go install gotest.tools/gotestsum@latest
pip install pre-commit
- name: Run pre-commit hooks
run: pre-commit run -a golangci-lint
- name: Run tests with gotestsum
run: |
mkdir -p ${{ github.workspace }}/artifacts
mkdir -p ${{ github.workspace }}/reports
gotestsum --packages="./..." \
--junitfile ${{ github.workspace }}/reports/go-test_go_tests.xml \
--jsonfile ${{ github.workspace }}/artifacts/go-test_go_tests.json \
--rerun-fails=2 \
--rerun-fails-max-failures=10 \
--rerun-fails-report ${{ github.workspace }}/artifacts/rerun_tests_go_tests.txt
github-actions-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Install npm
run: sudo apt-get install -y npm
- name: Install action-docs
run: npm install action-docs
- name: Install Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: '3.x'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit hooks
run: pre-commit run -a github-action-docs