initial open source #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
key: ${{ secrets.GO_MODULE_PRIVATE_KEY }} | |
- name: Setup access for private Go modules | |
run: | | |
git config --global url."ssh://[email protected]/".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 --porcelain | |
test -z '$(git status --porcelain)' || (echo "'make generate' made modifications. ensure 'make generate' has been run:"; git status -s; git --no-pager diff; false) | |
# lint code | |
make lint | |
test -z '$(git status --porcelain)' || (echo "'make lint' made modifications. ensure 'make lint' has been run:"; git status -s; git --no-pager diff; false) | |
- name: Test | |
run: make test |