-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (88 loc) · 2.84 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT_5432_TCP_ADDR: localhost
POSTGRES_PORT_5432_TCP_PORT: 5432
APP_URL: http://localhost:3000
RAILS_ENV: e2e
SECRET_KEY_BASE: f54c9d76c42e397e17cbc0d0a024da5a762a7a0d934839b417a77dac6fda65a49a37b32bcd229ac5fd5c1fedef8ed6acf7a57ed6465d6339862cdc0dfab8886f
AUTH_SECRET: secret
CONTACT_EMAIL: [email protected]
RESPONSIBLE_EMAIL: [email protected]
name: Run tests
on: push
jobs:
test:
name: Testing build
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:12-3.1-alpine
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
ports: ["5432:5432"]
steps:
- uses: actions/checkout@v4
with:
repository: wri/fti_api
ref: chore/upgrade-rails
path: otp_api
- name: Install API dependencies
run: |
sudo apt update --fix-missing
sudo apt-get -yqq install libpq-dev build-essential libcurl4-openssl-dev gdal-bin
npm install -g mjml
- name: Setup API Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: otp_api
- name: Setup API
working-directory: otp_api
run: |
bin/rails e2e:setup
- name: Run API
working-directory: otp_api
run: |
bin/rails s &
- uses: actions/checkout@v4
- name: Read .nvmrc
id: nvm
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
- uses: actions/setup-node@v2
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- run: yarn install
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Set Sample ENV Variables
run: |
echo "
PORT=4000
NODE_ENV=production
ENV=production
SECRET=some_secret
OTP_API_KEY=Bearer jwttoken
OTP_COUNTRIES='COG,CMR,COD,CAF,GAB'
OTP_COUNTRIES_IDS='7,47,45,188,53'
OTP_API=http://localhost:3000
TRANSIFEX_URL=https://www.transifex.com/api/2/project
TRANSIFEX_PROJECT=open-timber-portal
TRANSIFEX_SLUG=open-timber-portal
" > .env
- name: Pull translations from transifex
env:
TRANSIFEX_TOKEN: ${{ secrets.transifex-token }}
run: |
echo 'Pulling the translations…'
TRANSIFEX_API_TOKEN=${{ env.TRANSIFEX_API_TOKEN }} yarn transifex:pull
- name: Run Build
run: yarn build