From 8e7f3fedb3d1c56bb5f685cd6e6dd69ac026ed90 Mon Sep 17 00:00:00 2001 From: Ballard Date: Fri, 2 Feb 2024 13:27:19 -0500 Subject: [PATCH] chore: added dev-env-setup action --- .github/actions/dev-env-setup/action.yml | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/actions/dev-env-setup/action.yml diff --git a/.github/actions/dev-env-setup/action.yml b/.github/actions/dev-env-setup/action.yml new file mode 100644 index 000000000..cef75b6eb --- /dev/null +++ b/.github/actions/dev-env-setup/action.yml @@ -0,0 +1,56 @@ +name: "Set up registration dev environment" +description: "Sets up asdf and configures the cache" +runs: + using: composite + steps: + - name: asdf setup + uses: asdf-vm/actions/setup@v1 + - uses: actions/cache@v3 + id: asdf-cache-client + with: + path: | + ~/.asdf + ./client/.tool-versions + key: ${{ runner.os }}-asdf-cache-client-${{ hashFiles('client/.tool-versions') }} + - uses: actions/cache@v3 + id: asdf-cache-backend + with: + path: | + ~/.asdf + ./bc_obps/.tool-versions + key: ${{ runner.os }}-asdf-cache-backend-${{ hashFiles('bc_obps/.tool-versions') }} + - uses: actions/cache@v3 + id: yarn-cache + with: + path: | + ~/.cache/yarn + ./client/node_modules + key: ${{ runner.os }}-yarn-cache-${{ hashFiles('client/yarn.lock') }}-v2 + - name: Set up python + id: setup-python + uses: actions/setup-python@v4 + with: + python-version: "3.9.16" + - name: Install Poetry + uses: snok/install-poetry@v1 + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + working-directory: ./bc_obps + shell: bash + - name: Install server dev tools + working-directory: ./bc_obps + shell: bash + run: | + make install_backend_asdf_tools + make start_pg + make create_db