diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index 9b1064a..55a48bc 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -21,7 +21,27 @@ jobs: uses: actions/setup-go@v4 with: go-version: ${{ matrix.go-version }} - + - name: install gomigrate. + run: | + curl -L https://packagecloud.io/golang-migrate/migrate/gpgkey | sudo apt-key add - + echo "deb https://packagecloud.io/golang-migrate/migrate/ubuntu/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/migrate.list + sudo apt-get update + sudo apt-get install -y migrate + + - name: setup postgres + uses: ikalnytskyi/action-setup-postgres@v4 + with: + username: root + password: secret + database: simple_bank + port: 5432 + id: postgres + + - name: initdb tables + run: | + unset PGSERVICEFILE + make migrateup + - name: Run tests run: make gotest