diff --git a/replica_distance_service/.github/workflows/ci.yaml b/replica_distance_service/.github/workflows/ci.yaml new file mode 100644 index 00000000..e1f8918c --- /dev/null +++ b/replica_distance_service/.github/workflows/ci.yaml @@ -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 }}