2024-12-16 18:06:27 +00:00
|
|
|
name: Format and Lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
format-check:
|
|
|
|
runs-on: docker
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
2024-12-16 18:39:59 +00:00
|
|
|
go-version: '1.23.3'
|
2024-12-16 18:06:27 +00:00
|
|
|
|
2024-12-26 14:02:44 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-golang-
|
|
|
|
|
2024-12-16 18:06:27 +00:00
|
|
|
- name: Run Format Check
|
|
|
|
run: |
|
|
|
|
make format
|
2024-12-26 13:42:54 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: docker
|
2024-12-31 18:21:19 +00:00
|
|
|
container:
|
2024-12-31 18:42:30 +00:00
|
|
|
image: ghcr.io/aides-infra/aides-repo-api-test-image:20241231
|
2024-12-26 13:42:54 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
2024-12-26 14:02:44 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-12-26 13:42:54 +00:00
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: '1.23.3'
|
|
|
|
|
2024-12-26 14:02:44 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-golang-
|
|
|
|
|
2024-12-31 18:21:19 +00:00
|
|
|
- name: Prepare for tests
|
|
|
|
run: |
|
|
|
|
apt-get install apt-repo-tools
|
|
|
|
|
2024-12-26 13:42:54 +00:00
|
|
|
- name: Run Tests
|
|
|
|
run: |
|
|
|
|
make test-coverage
|