Skip to content

Commit

Permalink
feat: add CI stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <[email protected]>
  • Loading branch information
moul committed Sep 10, 2023
1 parent d664073 commit e71dcd2
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers.
* @moul
18 changes: 18 additions & 0 deletions .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: auto-author-assign

on:
pull_request_target:
types: [ opened, reopened ]

permissions:
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
83 changes: 83 additions & 0 deletions .github/workflows/gnoffee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: gnoffee

on:
pull_request:
paths:
- "go.sum"
- "**.go"
- "**.gnoffee"
- ".github/workflows/gnoffee.yml"
push:
branches: [ "main" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
go-version:
- "1.20.x"
- "1.21.x"
goarch:
- "amd64"
goos:
- "linux"
program:
- "gnoffee"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: go install
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }}

test:
strategy:
fail-fast: false
matrix:
go-version:
- "1.20.x"
- "1.21.x"
args:
- "test"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: test
run: |
export GOPATH=$HOME/go
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic"
make ${{ matrix.args }}
#- if: runner.os == 'Linux'
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# name: gnoffee
# flags: gnoffee,gnoffee-${{matrix.args}},go-${{ matrix.go-version }}
# files: ./coverage.out
# #fail_ci_if_error: ${{ github.repository == 'gnolang/gnoffee' }}
# fail_ci_if_error: false # temporarily

#docker-integration:
# strategy:
# fail-fast: false
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v3
# # TODO: setup docker caching
# - run: make test.docker
# - run: docker logs int_gnoffee || true

# TODO: docker-less integration test?
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "lint-pr"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
pr-title:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e71dcd2

Please sign in to comment.