Skip to content

Commit

Permalink
Merge pull request #4349 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy vX.X.X to production
  • Loading branch information
mbklein authored Feb 4, 2025
2 parents d3f4afc + 4c460c4 commit c589c15
Show file tree
Hide file tree
Showing 14 changed files with 1,355 additions and 1,076 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
otp-version: "26"
elixir-version: "1.15.4"
- name: Cache Elixir dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/deps
Expand All @@ -30,7 +30,7 @@ jobs:
${{ runner.os }}-hex-v6-${{ hashFiles('app/mix.lock') }}
${{ runner.os }}-hex-v6-
- name: Cache Elixir build
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/_build
Expand All @@ -40,7 +40,7 @@ jobs:
${{ runner.os }}-hex-v6-${{ hashFiles('app/mix.lock') }}
${{ runner.os }}-hex-v6-
- name: Cache JS dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/assets/node_modules
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
with:
node-version-file: ./.tool-versions
- name: Cache Elixir dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/deps
Expand All @@ -85,7 +85,7 @@ jobs:
${{ runner.os }}-hex-v6-${{ hashFiles('app/mix.lock') }}
${{ runner.os }}-hex-v6-
- name: Cache Elixir build
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/_build
Expand All @@ -95,7 +95,7 @@ jobs:
${{ runner.os }}-hex-v6-${{ hashFiles('app/mix.lock') }}
${{ runner.os }}-hex-v6-
- name: Cache JS dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/assets/node_modules
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
perl Makefile.PL && \
sudo make install
- name: Cache Elixir dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/deps
Expand All @@ -201,7 +201,7 @@ jobs:
${{ runner.os }}-hex-v6-${{ hashFiles('app/mix.lock') }}
${{ runner.os }}-hex-v6-
- name: Cache Elixir build
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/_build
Expand All @@ -211,7 +211,7 @@ jobs:
${{ runner.os }}-hex-v6-${{ hashFiles('app/mix.lock') }}
${{ runner.os }}-hex-v6-
- name: Cache JS dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
app/assets/node_modules
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,35 @@ If you would like to interact directly with the database

### Run the Elixir test suite

- run `mix test`
#### Start Test Services

In one terminal:
```
cd infrastructure/localstack
docker compose up
```

#### Provision Test Environment

Watch the logs until the services seem to stabilize. Then, in another terminal:
```
cd infrastructure/localstack
terraform init
terraform apply -auto-approve \
-var-file test.tfvars \
-var localstack_endpoint=https://localhost.localstack.cloud:4566
```

You will probably see `Warning: AWS account ID not found for provider`, but this can be safely ignored.

#### Run Tests

```
cd app
mix test [test args...]
```

**Note:** `mix test` can be run repeatedly without re-provisioning as long as the Docker services are running. If you stop the services, you will need to run Terraform again.

### GraphQL API

Expand Down
Loading

0 comments on commit c589c15

Please sign in to comment.