Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Test #3

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ jobs:
tags: |
${{ github.repository }}:${{ github.sha }}
${{ github.repository }}:test

- name: Run tests
run: |
docker pull ${{ github.repository }}:${{ github.sha }}
docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT
77 changes: 77 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

name: Dependabot auto-merge

on: pull_request

permissions:
contents: read


jobs:
docker-build:
name: Build and test
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' || github.event.action == 'synchronize' && startsWith( github.head_ref, 'dependabot' ) }}

env:
IMAGE_NAME: ${{ github.repository }}
steps:
- name: checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ github.repository }}:${{ github.sha }}
${{ github.repository }}:latest

- name: Build and push for test branch
if: github.ref == 'refs/heads/test'
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ github.repository }}:${{ github.sha }}
${{ github.repository }}:test

- name: Run tests
run: |
docker pull ${{ github.repository }}:${{ github.sha }}
docker run --rm ${{ github.repository }}:${{ github.sha }} --exchanges kucoin kraken --symbols BTC/USDT ETH/USDT

dependabot:
runs-on: ubuntu-latest
permissions: write-all
needs: build
if: ${{ github.actor == 'dependabot[bot]' || github.event.action == 'synchronize' && startsWith( github.head_ref, 'dependabot' ) }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve and enable auto-merge for Dependabot PRs
if: |
${{ ( steps.metadata.outputs.package-ecosystem == 'hex' && steps.metadata.outputs.update-type == 'version-update:semver-patch' ) || steps.metadata.outputs.package-ecosystem == 'github-actions' }}
run: |
gh pr review --approve "$PR_URL"
gh pr edit "$PR_URL" -t "(auto merged) $PR_TITLE"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
PR_TITLE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading