Merge pull request #10 from gauzy-gossamer/whois_cache #109
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: Go package | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: dbpassword | |
POSTGRES_DB: registry | |
POSTGRES_USER: registry | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
sudo apt-get update | |
sudo apt-get install --yes --no-install-recommends postgresql-client | |
- name: Add hosts to /etc/hosts | |
run: sudo echo "127.0.0.1 regdb" | sudo tee -a /etc/hosts | |
- name: Set up python | |
uses: actions/setup-python@v2 | |
- name: Prepare db | |
run: | | |
./prepare_docker.sh | |
cat sql/init.sql sql/test2.sql | PGPASSWORD="dbpassword" psql -h regdb -p 5432 -U registry registry | |
- uses: syphar/restore-virtualenv@v1 | |
id: cache-virtualenv | |
- name: Test admin | |
working-directory: ./admin | |
run: | | |
pip install -r requirements.txt | |
cp .env.example .env | |
py.test | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Install dependencies | |
working-directory: ./registry | |
run: go get . | |
- name: Test Registry | |
working-directory: ./registry | |
run: | | |
PWD=$(pwd) | |
cat server.conf.example | sed "s|/usr/src/registry|$PWD|" > server.conf | |
go test ./... | |
- name: Build Registry | |
working-directory: ./registry | |
run: go build -v ./... | |
- name: Install whois dependencies | |
working-directory: ./whois | |
run: go get . | |
- name: Build Whois | |
working-directory: ./whois | |
run: go build -v ./... | |
- name: Install logger dependencies | |
working-directory: ./logger | |
run: go get . | |
- name: Build Logger | |
working-directory: ./logger | |
run: go build -v ./... |