Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
harveyxia committed Oct 29, 2024
1 parent 3486513 commit 318806d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.22"
env:
GOPRIVATE: github.com/reddit/achilles-sdk-api

container:
image: golang:${{ matrix.go-version }}

steps:
- uses: actions/checkout@v3

- name: Workaround Git Security Warning
run: |
# Workaround a bug in github actions:
# https://github.com/actions/runner-images/issues/6775.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Setup access for private Go modules
run: |
git config --global url."ssh://git@github.com/".insteadOf https://github.com/
- name: Generate
run: |
# needed for running `tar -xJv` for installing shellcheck
apt-get update
apt-get install xz-utils
make generate
git status
git diff
test -z "$(git status --porcelain)"
# lint code
make lint
git status
git diff
test -z "$(git status --porcelain)"
- name: Test
run: make test

0 comments on commit 318806d

Please sign in to comment.