diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79f0a52..a96ae97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,51 +1,41 @@ # @format name: ci-test - -on: +"on": push: - branches: ["main"] + branches: + - main pull_request: - branches: ["main"] - + branches: + - main jobs: Test: runs-on: ubuntu-latest - services: - # Label used to access the service container + services: postgres: - # Docker Hub image image: postgres - # Provide the password for postgres env: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres POSTGRES_DB: simple_bank - # Set health checks to wait until postgres has started options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s + --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 ports: - # Maps tcp port 5432 on service container to the host - - 5432:5432 - + - "5432:5432" steps: - uses: actions/checkout@v3 - - name: Set up Go uses: actions/setup-go@v3 with: go-version: 1.18 - - name: Install golang migrate - run: | - curl -L https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-arm64.tar.gz | tar xvz - sudo move migrate.linux-arm64 /usr/bin/migrate - + run: > + curl -L + https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-arm64.tar.gz + | tar xvz + sudo move migrate.linux-arm64 /usr/bin/migrate - name: Run migration run: make migrateup - - name: Test run: make test