Skip to content

Various bug fixes in frontend and backend #271

Various bug fixes in frontend and backend

Various bug fixes in frontend and backend #271

Workflow file for this run

---
name: Build
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
branches:
- '*'
defaults:
run:
shell: bash
jobs:
build:
name: Build python package
runs-on: ubuntu-22.04
env:
TZ: UTC
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.7
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v7
- name: Check code integrity
run: nix develop --command make check
- name: Check docs
run: nix develop --command make docs
- name: Check REUSE compliance
run: nix-shell -p reuse --run "reuse lint"
- name: Build Release Package
run: |
echo "Building package"
nix develop --command make clean build
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: python-build-artifacts
path: dist/
tests:
name: Test python package
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set PIPX_DEFAULT_PYTHON
run: |
echo "PIPX_DEFAULT_PYTHON=$(which python3)" >> $GITHUB_ENV
- name: git checkout
uses: actions/checkout@v4
- name: Fetch python build artifact
uses: actions/download-artifact@v4
with:
name: python-build-artifacts
path: dist/
- name: install
run: |
pip install build
make install
- name: run checks
run: |
make check
- name: run tests
run: |
make tests
release:
runs-on: ubuntu-22.04
needs: [build, tests]
if: github.event_name == 'push' && contains(github.event.ref, '/tags/') && contains(github.event.base_ref, 'main') # Only runs if the original event was a tag
steps:
- name: Checkout the repository
uses: actions/checkout@v3.1.0
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v1
- name: Fetch python build artifact
uses: actions/download-artifact@v4
with:
name: python-build-artifacts
path: dist/
- name: Upload Release to PyPI
run: |
echo "Uploading source code"
nix develop --command python -m twine upload --verbose --non-interactive --skip-existing -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*
docker:
runs-on: ubuntu-latest
needs: [build, tests]
if: github.event_name == 'push' && contains(github.event.base_ref, 'main')
permissions:
contents: read
packages: write
env:
IMAGE_ID: ghcr.io/samsungds/nvme-spex-webserver
steps:
- name: Checkout the repository
uses: actions/checkout@v3.1.0
- name: Fetch python build artifact
uses: actions/download-artifact@v4
with:
name: python-build-artifacts
path: dist/
- name: Build docker image
run: |
docker build \
-t $IMAGE_ID \
.
- name: Log into GitHub Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push to ghcr.io
run: |
docker push ${IMAGE_ID}