-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* GitHub Action for Running Test 1 * GitHub Action for Running Test 2 * Add postgres install action * Add postgres as a service * Add postgres as a service 2 * Add postgres as a service 4 * Add postgres as a service 5 * Add postgres as a service 6 * Add postgres as a service 7 * Add postgres as a service 8 * Add postgres as a service 9 * Add postgres as a service 10 * Add postgres as a service 11 * Add postgres as a service 12 * Add postgres as a service 13 * Add postgres as a service 14 * Add postgres as a service 15 * Add postgres as a service 16 * Try with newer browser install step * Delete manifest.yml * Try with newer browser install step 2 * Try with newer browser install step 3 * Try with newer browser install step 4 * Try with newer browser install step 5 --------- Co-authored-by: Xavier Metichecchia <XavierMetichecchia>
- Loading branch information
1 parent
e38a5a3
commit 33536cc
Showing
2 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# deploy.yml test | ||
name: Deploy analytics-reporter to cloud.gov | ||
|
||
on: | ||
push: | ||
branches: | ||
- github_actions | ||
|
||
jobs: | ||
Run-tests: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
#Use environment name based on branch name | ||
environment: ${{ github.head_ref || github.ref_name }} | ||
|
||
#Spin up postgres as a service, wait till healthy before moving on. Uses latest Postgres Version. | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_DB: analytics_reporter_test | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
options: | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
|
||
steps: | ||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
#Install latest LTS version of node. | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
cache: 'npm' | ||
|
||
- name: Install Latest Firefox | ||
run: | | ||
sudo apt-get remove -y firefox | ||
wget -O FirefoxSetup.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US" | ||
tar xjf FirefoxSetup.tar.bz2 -C /opt/ | ||
sudo ln -s /opt/firefox/firefox /usr/bin/firefox | ||
- name: Install Latest Chrome | ||
run: | | ||
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
sudo dpkg -i google-chrome-stable_current_amd64.deb | ||
sudo apt-get install -f | ||
# - name: Install Firefox | ||
# uses: browser-actions/[email protected] | ||
# with: | ||
# firefox-version: latest | ||
# | ||
# - name: Install Chrome | ||
# uses: browser-actions/[email protected] | ||
# with: | ||
# chrome-version: latest | ||
# | ||
# - name: Install Browsers | ||
# uses: abhi1693/[email protected] | ||
# with: | ||
# browser: chrome, firefox | ||
# version: latest | ||
|
||
- name: Create Checksum of package.json | ||
run: echo PACKAGE_CHECKSUM="$(shasum package.json | awk '{ print $1 }')" >> "$GITHUB_ENV" | ||
|
||
- name: Restore Cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ./node_modules | ||
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }} | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Save Cache | ||
uses: actions/cache/save@v4 | ||
id: cache | ||
with: | ||
path: ./node_modules | ||
key: v1-dependencies-${{ env.PACKAGE_CHECKSUM }} | ||
|
||
- name: Run Tests | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: analytics_reporter_test | ||
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} | ||
run: npm test |
This file contains 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