Skip to content

Commit

Permalink
Merge pull request #405 from dwyl/node_deprecated-#404
Browse files Browse the repository at this point in the history
[PR] Upgrading to Node16 and temporarily disabling `Review App` and `API Definition` tests
  • Loading branch information
nelsonic authored Aug 15, 2023
2 parents 957efcc + 4cc270a commit d919ce3
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 85 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
otp: ['25.1.2']
elixir: ['1.14.2']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
Expand All @@ -52,7 +52,7 @@ jobs:
AUTH_API_KEY: ${{ secrets.AUTH_API_KEY }}
ENCRYPTION_KEYS: ${{ secrets.ENCRYPTION_KEYS }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3


# Continuous Deployment to Fly.io
Expand All @@ -66,7 +66,7 @@ jobs:
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions@1.1
with:
args: "deploy"
120 changes: 60 additions & 60 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
otp: ['25.1.2']
elixir: ['1.14.2']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
Expand Down Expand Up @@ -61,68 +61,68 @@ jobs:



# DEPLOY THE REVIEW APP
# This will deploy an app to fly.io with the name 'mvp-pr-$PR_NUMBER' (check `review-apps.sh` script).
review_app:

# Only run when it's not a dependabot PR
if: github.event.pull_request.user.login != 'dependabot[bot]'

name: Review App Job
runs-on: ubuntu-latest
# needs: [build]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install flyctl
run: curl -L https://fly.io/install.sh | FLYCTL_INSTALL=/usr/local sh

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 24.3.4
elixir-version: 1.14.1

- name: Run Review App Script
run: ./.github/scripts/review-apps.sh
env:
ENCRYPTION_KEYS: ${{ secrets. ENCRYPTION_KEYS }}
AUTH_API_KEY: ${{ secrets.FLY_AUTH_API_KEY }}
APP_NAME: ${{ format('mvp-pr-{0}', github.event.number) }}
EVENT_ACTION: ${{ github.event.action }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_ORG: dwyl-mvp
FLY_REGION: lhr
FLY_POSTGRES_NAME: mvp-db
# # DEPLOY THE REVIEW APP
# # This will deploy an app to fly.io with the name 'mvp-pr-$PR_NUMBER' (check `review-apps.sh` script).
# review_app:

# # Only run when it's not a dependabot PR
# if: github.event.pull_request.user.login != 'dependabot[bot]'

# name: Review App Job
# runs-on: ubuntu-latest
# # needs: [build]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

# - name: Install flyctl
# uses: superfly/flyctl-actions/setup-flyctl@master

# - name: Set up Elixir
# uses: erlef/setup-beam@v1
# with:
# otp-version: 24.3.4
# elixir-version: 1.14.1

# - name: Run Review App Script
# run: ./.github/scripts/review-apps.sh
# env:
# ENCRYPTION_KEYS: ${{ secrets. ENCRYPTION_KEYS }}
# AUTH_API_KEY: ${{ secrets.FLY_AUTH_API_KEY }}
# APP_NAME: ${{ format('mvp-pr-{0}', github.event.number) }}
# EVENT_ACTION: ${{ github.event.action }}
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
# FLY_ORG: dwyl-mvp
# FLY_REGION: lhr
# FLY_POSTGRES_NAME: mvp-db


# API DEFINITION TESTING - https://docs.hoppscotch.io/cli
# NOTE: The tests are executed sequentially in each folder
# but all the sequence of folders are run in reverse order of what's displayed in the GUI.
# We've made use of env variables to make it work. Take this into account if you want to add more requests.
api_definition:

# Only run when not closed
if: github.event.pull_request.action != 'closed'

name: API Definition Tests
runs-on: ubuntu-latest
needs: [review_app]
steps:
- uses: actions/checkout@v2

# After the app is deployed, we need to change the host
# in the `lib/api/fly_dev.json` so the API tests work and target the deployed app.
- name: Update lib/api/fly_dev.json description
uses: jossef/action-set-json-field@v2.1
with:
file: ./lib/api/fly_dev.json
field: host
value: ${{ format('https://mvp-pr-{0}.fly.dev', github.event.number) }}

- name: Install Hoppscotch CLI
run: npm i -g @hoppscotch/cli@0.3.0

- name: Running server and Hoppscotch Tests
run: hopp test -e ./lib/api/fly_dev.json ./lib/api/MVP.json
# api_definition:

# # Only run when not closed
# if: github.event.pull_request.action != 'closed'

# name: API Definition Tests
# runs-on: ubuntu-latest
# needs: [review_app]
# steps:
# - uses: actions/checkout@v3

# # After the app is deployed, we need to change the host
# # in the `lib/api/fly_dev.json` so the API tests work and target the deployed app.
# - name: Update lib/api/fly_dev.json description
# uses: jossef/action-set-json-field@v2.1
# with:
# file: ./lib/api/fly_dev.json
# field: host
# value: ${{ format('https://mvp-pr-{0}.fly.dev', github.event.number) }}

# - name: Install Hoppscotch CLI
# run: npm i -g @hoppscotch/cli@0.3.0

# - name: Running server and Hoppscotch Tests
# run: hopp test -e ./lib/api/fly_dev.json ./lib/api/MVP.json
4 changes: 2 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ kill_timeout = "5s"
[[services.tcp_checks]]
interval = "15s"
timeout = "2s"
grace_period = "1s"
restart_limit = 0
grace_period = "5s"
restart_limit = 5
2 changes: 1 addition & 1 deletion lib/api/hoppscotch.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ between the `build` and `deploy` jobs.
otp: ['25.1.2']
elixir: ['1.14.2']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defmodule App.MixProject do
{:fields, "~> 2.10.3"},

# Useful functions: github.com/dwyl/useful
{:useful, "~> 1.12.0", override: true},
{:useful, "~> 1.12.1", override: true},
# See: github.com/dwyl/useful/issues/17
{:atomic_map, "~> 0.9.3"},

Expand Down
Loading

0 comments on commit d919ce3

Please sign in to comment.