append echo in seperate text file #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Django CI | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.9] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Create secrets file | |
run: | | |
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> .env | |
echo "DJANGO_GOOGLE_OAUTH2_CLIENT_ID=${{ secrets.DJANGO_GOOGLE_OAUTH2_CLIENT_ID }}" >> .env | |
echo "DJANGO_GOOGLE_OAUTH2_CLIENT_SECRET=${{ secrets.DJANGO_GOOGLE_OAUTH2_CLIENT_SECRET }}" >> .env | |
echo "DJANGO_ORCID_OAUTH2_CLIENT_URL=${{ secrets.DJANGO_ORCID_OAUTH2_CLIENT_URL }}" >> .env | |
echo "DJANGO_ORCID_OAUTH2_CLIENT_ID=${{ secrets.DJANGO_ORCID_OAUTH2_CLIENT_ID }}" >> .env | |
echo "DJANGO_ORCID_OAUTH2_CLIENT_SECRET=${{ secrets.DJANGO_ORCID_OAUTH2_CLIENT_SECRET }}" >> .env | |
echo "DJANGO_ORCID_OAUTH2_URL=${{ secrets.DJANGO_ORCID_OAUTH2_URL }}" >> .env | |
echo "SERVER_VERSION=${{ secrets.SERVER_VERSION }}" >> .env | |
echo "SERVER_URL=${{ secrets.SERVER_URL }}" >> .env | |
echo "DATABASE=${{ secrets.DATABASE }}" >> .env | |
echo "EMAIL_BACKEND=${{ secrets.EMAIL_BACKEND }}" >> .env | |
- name: Debug Secrets | |
run: | | |
cat .env | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r server/requirements.txt | |
- name: Run Tests | |
env: | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
DJANGO_GOOGLE_OAUTH2_CLIENT_ID: ${{ secrets.DJANGO_GOOGLE_OAUTH2_CLIENT_ID }} | |
DJANGO_GOOGLE_OAUTH2_CLIENT_SECRET: ${{ secrets.DJANGO_GOOGLE_OAUTH2_CLIENT_SECRET }} | |
DJANGO_ORCID_OAUTH2_CLIENT_URL: ${{ secrets.DJANGO_ORCID_OAUTH2_CLIENT_URL }} | |
DJANGO_ORCID_OAUTH2_CLIENT_ID: ${{ secrets.DJANGO_ORCID_OAUTH2_CLIENT_ID }} | |
DJANGO_ORCID_OAUTH2_CLIENT_SECRET: ${{ secrets.DJANGO_ORCID_OAUTH2_CLIENT_SECRET }} | |
DJANGO_ORCID_OAUTH2_URL: ${{ secrets.DJANGO_ORCID_OAUTH2_URL }} | |
SERVER_VERSION: ${{ secrets.SERVER_VERSION }} | |
SERVER_URL: ${{ secrets.SERVER_URL }} | |
DATABASE: ${{ secrets.DATABASE }} | |
EMAIL_BACKEND: ${{ secrets.EMAIL_BACKEND }} | |
run: | | |
cd server # Change to the subdirectory | |
cp ../.env . # Copy the .env file to the server directory | |
python3.9 manage.py test | |
- name: Clean up | |
run: | | |
rm .env | |