Skip to content

Commit

Permalink
Add CI action
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyisi committed Oct 22, 2024
1 parent d0d6066 commit 46bdbfc
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions replica_distance_service/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI/CD

on:
push:
branches:
- "*"
tags:
- "*"

pull_request:

jobs:
test:
strategy:
matrix:
python-version: [3.12]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install --no-cache-dir -r requirements.txt
pip install --no-cache-dir -r requirements_dev.txt
pip list
- name: Lint with Flake8
run: |
flake8 --exclude=tests/* --ignore=E501
- name: Test with pytest
run: |
python -m pytest -r sx
- name: Report coverage with Codecov
if: github.event_name == 'push'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@master

- name: Extract tag name
shell: bash
run: echo "##[set-output name=imagetag;]$(echo ${GITHUB_REF##*/})"
id: extract_tag_name

- name: Build Uproot Image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: sslhep/servicex_replica_distance_service:${{ steps.extract_tag_name.outputs.imagetag }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit 46bdbfc

Please sign in to comment.