create local env file for pg #16
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: balance-by-account | |
on: | |
push: | |
paths: | |
- 'services/balance-by-account/**' | |
- 'crates/**' | |
- 'migrations/schema/*' | |
branches-ignore: | |
- 'master' | |
- 'develop' | |
jobs: | |
lint_test: | |
name: lint test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
- name: linting | |
run: | | |
cargo fmt -- --check | |
cargo clippy -- -Dwarnings | |
unit_test: | |
name: unit test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
- name: unit test | |
run: cargo test | |
database_test: | |
name: database test in local docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
- name: test database | |
run: make -C crates/pg test-db | |
integration_test: | |
name: integration test in local docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
- name: install latest psql client | |
run: | | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install --yes --no-install-recommends postgresql-client | |
- name: install golang-migrate | |
run: | | |
curl -LO https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-amd64.deb | |
sudo dpkg -i migrate.linux-amd64.deb | |
rm migrate.linux-amd64.deb | |
- name: start services | |
run: make start | |
- name: test service integration | |
run: make -C ./tests test-local | |
- name: clean up | |
run: make stop | |
client_test: | |
name: client test in local docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: start services | |
run: make start | |
- name: e2e test client | |
run: make -C ./client test-ci | |
- name: clean up | |
run: make stop | |
push_image: | |
name: push image to dev ecr | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: us-east-1 | |
APP_DIR: services/balance-by-account | |
needs: [lint_test, unit_test, database_test, integration_test, client_test] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: mask values | |
run: echo "::add-mask::${{ secrets.AWS_ACCOUNT_ID }}" | |
- name: build image | |
run: make -C $APP_DIR build-image | |
- name: tag image | |
run: ENV_ID=${{ secrets.DEV_ENV_ID }} make -C $APP_DIR tag-dev-image | |
- name: push image | |
run: ENV_ID=${{ secrets.DEV_ENV_ID }} make -C $APP_DIR push-dev-image |