Skip to content

Creating course ads all available students to it #532

Creating course ads all available students to it

Creating course ads all available students to it #532

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
Style:
name: Code Style
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10.4"]
steps:
- uses: actions/checkout@v3
- name: Setup timezone
uses: zcong1993/setup-timezone@master
with:
timezone: UTC
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: |
sudo apt install -y $(grep -o ^[^#][[:alnum:]-]* "packages.list")
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Run isort
run: |
isort --check-only .
- name: Run black
run: |
black --check .
- name: Run flake8
run: |
flake8 .
Sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10.4"]
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install tox, dotenv and psycopg2
run: |
sudo apt install -y $(grep -o ^[^#][[:alnum:]-]* "packages.list")
python3 -m pip install --upgrade pip
pip3 install tox
pip3 install python-dotenv
pip3 install psycopg2-binary
- name: Set up .pem file
run: |
mkdir -p ${{ github.workspace }}/keys
echo "${{ secrets.PEM_PRIVATE }}" > ${{ github.workspace }}/keys/private.pem
chmod 600 ${{ github.workspace }}/keys/private.pem
echo "${{ secrets.PEM_PUBLIC }}" > ${{ github.workspace }}/keys/public.pem
chmod 600 ${{ github.workspace }}/keys/public.pem
- name: Run tox
run: tox
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}