Skip to content

Commit

Permalink
[feat] refactor CI
Browse files Browse the repository at this point in the history
  • Loading branch information
phoinixgrr committed Oct 26, 2023
1 parent 9058614 commit a9c05b3
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 30 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Test

on:
push:
branches:
- master
pull_request:
permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Lint
run: make lint
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Test
run: make test
build:
name: Build
runs-on: ubuntu-latest
needs: [lint,test]
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Build
run: make build
- name: Make Clean
run: make clean
60 changes: 30 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Test
# name: Test

on:
push:
branches:
- master
pull_request:
# on:
# push:
# branches:
# - master
# pull_request:

permissions:
contents: read
checks: write
pull-requests: write
# permissions:
# contents: read
# checks: write
# pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
# jobs:
# test:
# runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.7
# - name: Install Go
# uses: actions/setup-go@v4
# with:
# go-version: 1.20.7

- name: Run tests
run: |
go install gotest.tools/gotestsum@latest
mkdir -p test-reports
gotestsum --junitfile test-reports/unit-tests.xml
# - name: Run tests
# run: |
# go install gotest.tools/gotestsum@latest
# mkdir -p test-reports
# gotestsum --junitfile test-reports/unit-tests.xml

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: test-reports/unit-tests.xml
# - name: Publish Unit Test Results
# uses: EnricoMi/publish-unit-test-result-action@v1
# if: always()
# with:
# files: test-reports/unit-tests.xml

0 comments on commit a9c05b3

Please sign in to comment.