Skip to content

Bump cryptography from 46.0.3 to 46.0.5 #231

Bump cryptography from 46.0.3 to 46.0.5

Bump cryptography from 46.0.3 to 46.0.5 #231

Workflow file for this run

name: CI
on:
workflow_dispatch:
inputs:
push-docker-image-to-harbor:
description: 'Push Docker Image to Harbor'
type: boolean
default: false
pull_request:
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
name: Unit Tests
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Run tests
run: |
docker build --file Dockerfile --target test --tag scigateway-auth:test .
docker run \
--name scigateway-auth \
scigateway-auth:test \
pytest --config-file test/pytest.ini --cov scigateway_auth --cov-report xml test/ -v
docker cp scigateway-auth:/app/coverage.xml coverage.xml
- name: Upload code coverage report
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
linting:
runs-on: ubuntu-latest
name: Linting
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.11'
- name: Install Nox
run: pip install nox==2024.10.9
- name: Install Poetry
run: pip install poetry~=2.0
- name: Run Nox lint session
run: nox -s lint
formatting:
runs-on: ubuntu-latest
name: Code Formatting
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.11'
- name: Install Nox
run: pip install nox==2024.10.9
- name: Install Poetry
run: pip install poetry~=2.0
- name: Run Nox black session
run: nox -s black
safety:
runs-on: ubuntu-latest
name: Dependency Safety
steps:
- name: Checkout repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.11'
- name: Install Nox
run: pip install nox==2024.10.9
- name: Run Nox safety session
run: nox -s safety
docker:
needs: [tests, linting, formatting, safety]
name: Docker
runs-on: ubuntu-latest
env:
PUSH_DOCKER_IMAGE_TO_HARBOR: ${{ inputs.push-docker-image-to-harbor != null && inputs.push-docker-image-to-harbor || 'false' }}
steps:
- name: Check out repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v3.5.2
- name: Login to Harbor
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: harbor.stfc.ac.uk/datagateway
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: harbor.stfc.ac.uk/datagateway/scigateway-auth
- name: ${{ fromJSON(env.PUSH_DOCKER_IMAGE_TO_HARBOR) && 'Build and push Docker image to Harbor' || 'Build Docker image' }}
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
push: ${{ fromJSON(env.PUSH_DOCKER_IMAGE_TO_HARBOR) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: prod