build(deps): bump aws-actions/configure-aws-credentials from 5 to 6 #1512
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup: | |
| name: asdf and Elixir dependencies | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-key-asdf: ${{ steps.cache-keys.outputs.asdf }} | |
| cache-key-mix: ${{ steps.cache-keys.outputs.mix }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set cache keys | |
| id: cache-keys | |
| run: | | |
| echo "asdf-restore=cache-asdf-" >> $GITHUB_OUTPUT | |
| echo "asdf=cache-asdf-${{ hashFiles('.tool-versions') }}" >> $GITHUB_OUTPUT | |
| echo "mix-restore=cache-mix-${{ hashFiles('.tool-versions') }}-" >> $GITHUB_OUTPUT | |
| echo "mix=cache-mix-${{ hashFiles('.tool-versions') }}-${{ hashFiles('**/mix.lock') }}" >> $GITHUB_OUTPUT | |
| - name: asdf cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.asdf | |
| key: ${{ steps.cache-keys.outputs.asdf }} | |
| restore-keys: ${{ steps.cache-keys.outputs.asdf-restore }} | |
| id: asdf-cache | |
| - uses: asdf-vm/actions/install@v4 | |
| if: steps.asdf-cache.outputs.cache-hit != 'true' | |
| - name: Setup asdf environment | |
| uses: mbta/actions/reshim-asdf@v2 | |
| - name: mix rebar and hex | |
| run: | | |
| mix local.rebar --force | |
| mix local.hex --force | |
| if: steps.asdf-cache.outputs.cache-hit != 'true' | |
| - name: Mix cache | |
| id: deps-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ steps.cache-keys.outputs.mix }} | |
| restore-keys: ${{ steps.cache-keys.outputs.mix-restore }} | |
| - name: Install and compile Mix dependencies | |
| if: steps.deps-cache.outputs.cache-hit != 'true' | |
| run: | | |
| mix deps.get | |
| mix deps.compile | |
| MIX_ENV=test mix deps.compile | |
| build_elixir: | |
| name: Build and test Elixir | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| env: | |
| DATABASE_USER: postgres | |
| DATABASE_PASSWORD: postgres | |
| DATABASE_HOST: localhost | |
| DATABASE_NAME: mobile_app_backend_test | |
| DATABASE_DISABLE_SSL: insecure-yes | |
| services: | |
| postgres: | |
| image: postgres | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_USER: ${{env.DATABASE_USER}} | |
| POSTGRES_PASSWORD: ${{env.DATABASE_PASSWORD}} | |
| POSTGRES_DB: ${{env.DATABASE_NAME}} | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - name: asdf cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: ~/.asdf | |
| key: ${{ needs.setup.outputs.cache-key-asdf }} | |
| - name: Setup asdf environment | |
| uses: mbta/actions/reshim-asdf@v2 | |
| - uses: actions/checkout@v6 | |
| - name: Restore Mix cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ needs.setup.outputs.cache-key-mix }} | |
| - name: Compile (warnings as errors) | |
| run: mix compile --force --warnings-as-errors | |
| - name: Credo | |
| run: mix credo --strict | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Run tests | |
| run: mix test --cover | |
| - name: Report test coverage | |
| # Disabled due to dependency issues | |
| if: false | |
| uses: mbta/github-actions-report-lcov@v1 | |
| with: | |
| coverage-files: cover/lcov.info | |
| artifact-name: code-coverage-report | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: mbta/actions/dialyzer@v2 | |
| - name: Check for unused dependencies | |
| run: mix deps.unlock --check-unused | |
| docker_build: | |
| name: Check that the Docker container will build and run | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: docker build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: docker compose build | |
| run: docker compose build | |
| - name: docker compose up | |
| run: docker compose up --wait | |
| env: | |
| API_KEY: ${{secrets.API_KEY}} | |
| API_URL: ${{secrets.API_URL}} | |
| - name: ensure running properly | |
| run: docker compose exec --no-TTY mobile-app-backend wget --spider -S http://localhost:4000/ | |
| - name: show docker container logs | |
| run: docker compose logs mobile-app-backend | |
| if: ${{ !cancelled() }} | |
| load_test: | |
| name: Check Python load tests for basic validity | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Read asdf versions | |
| id: asdf | |
| run: cat load_testing/.tool-versions | sed 's/ /=/' | tee -a "$GITHUB_OUTPUT" | |
| - name: Install poetry | |
| run: pipx install poetry==${{steps.asdf.outputs.poetry}} | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{steps.asdf.outputs.python}} | |
| cache: poetry | |
| cache-dependency-path: load_testing/poetry.lock | |
| - run: cd load_testing && poetry install | |
| - run: cd load_testing && poetry run ruff check | |
| - run: cd load_testing && poetry run mypy locustfile.py |