set env to qa #28
Workflow file for this run
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "add_dockerfiles", "newlance", "test_new_workflow" ] | |
pull_request: | |
branches: [ "add_dockerfiles", "newlance" ] | |
permissions: | |
contents: read | |
jobs: | |
testing: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
name: Ethlance build and test | |
env: | |
ETHLANCE_ENV: qa | |
services: | |
ipfs-daemon: | |
image: district0x/ipfs-daemon:latest | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: pass | |
POSTGRES_USER: ethlanceuser | |
POSTGRES_DB: ethlance-test | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout ethlance code | |
uses: actions/checkout@v4 | |
- name: Checkout ethlance-configs repo | |
uses: actions/checkout@v4 | |
with: | |
repository: district0x/ethlance-config | |
path: ethlance-config | |
token: ${{ secrets.ETHLANCE_CONFIG_PAT }} | |
ref: docker_build | |
- name: Copy configs | |
run: | | |
cp -r ethlance-config/config . | |
ls -lah config/ | |
- name: Run ganache service | |
run: | | |
docker run --rm -d --name ganache -p 8550:8550 trufflesuite/ganache:v7.9.1 -v -m "easy leave proof verb wait patient fringe laptop intact opera slab shine" -p 8550 -b 0.5 --chain.allowUnlimitedContractSize=true | |
# - name: Get yarn cache directory for top-level ethlance packages | |
# id: yarn-cache-top-level-path | |
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
# - name: Get yarn cache directory for ethlance Server packages | |
# id: yarn-cache-server-path | |
# run: | | |
# cd server | |
# echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
# - name: Get yarn cache directory for ethlance UI packages | |
# id: yarn-cache-ui-path | |
# run: | | |
# cd ui | |
# echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
# cd .. | |
- name: Restore Top level cache directory for Ethlance | |
uses: actions/cache@v3 | |
id: yarn-cache-top-level # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-ethlance-top-level-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-ethlance-top-level-yarn- | |
- name: Install ethlance top-level node modules | |
run: | | |
yarn install | |
- name: Restore Server cache directory for Ethlance | |
uses: actions/cache@v3 | |
id: yarn-cache-server # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ./server/node_modules | |
key: ${{ runner.os }}-ethlance-server-yarn-${{ hashFiles('server/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-ethlance-server-yarn- | |
- name: Deploy contracts | |
run: | | |
npx truffle migrate --network ganache-test --reset | |
- name: Run test suite | |
run: | | |
bb run-server-tests | |
# - name: Restore UI cache directory for Ethlance | |
# uses: actions/cache@v3 | |
# id: yarn-cache-ui # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
# with: | |
# path: ./ui/node_modules | |
# key: ${{ runner.os }}-ethlance-server-yarn-${{ hashFiles('ui/yarn.lock') }} | |
# restore-keys: | | |
# ${{ runner.os }}-ethlance-server-yarn- | |
# - name: Install ethlance ui node modules | |
# run: | | |
# cd ui && yarn install | |
# docker_build: | |
# strategy: | |
# matrix: | |
# image: ["server", "ui"] | |
# env: ["qa"] | |
# permissions: | |
# contents: read | |
# name: Docker Build | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout ethlance code | |
# uses: actions/checkout@v4 | |
# - name: Checkout ethlance-configs repo | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: district0x/ethlance-config | |
# path: ethlance-config | |
# token: ${{ secrets.ETHLANCE_CONFIG_PAT }} | |
# ref: docker_build | |
# - name: Copy configs | |
# run: | | |
# cp -r ethlance-config/config . | |
# ls -lah config/ | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v2 | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v2 | |
# - name: Configure AWS Credentials | |
# uses: aws-actions/configure-aws-credentials@v4 | |
# with: | |
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
# - name: Login to Amazon ECR | |
# id: login-ecr | |
# uses: aws-actions/amazon-ecr-login@v2 | |
# - name: Build and push | |
# uses: docker/build-push-action@v4 | |
# with: | |
# context: . | |
# platforms: linux/amd64,linux/arm64 | |
# file: docker-builds/${{ matrix.image }}/Dockerfile | |
# build-args: BUILD_ENV=${{ matrix.env }} | |
# push: true | |
# tags: ${{ secrets.ECR_REGISTRY }}/ethlance-${{ matrix.image }}:latest-${{ matrix.env }} |