-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 1.75 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: test
on:
workflow_dispatch:
push:
branches: [ "*" ]
env:
artifact_name: test_project
jobs:
create-test-project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt install cookiecutter pre-commit npm
pip install pipenv
npm install -g pnpm
- name: create project with cookiecutter
run: |
git config --global init.defaultBranch main
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
cookiecutter --no-input --output-dir /tmp ./ project_slug=github_test_project
- id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
/tmp/github_test_project
!/tmp/github_test_project/**/node_modules
retention-days: 1
test-test-project:
runs-on: ubuntu-latest
needs: [ create-test-project ]
services:
db:
image: docker.io/postgres
ports:
- 5432:5432
env:
POSTGRES_USER: github_test_project
POSTGRES_PASSWORD: github_test_project
POSTGRES_DB: github_test_project
steps:
- name: install system dependencies
run: |
sudo apt install npm
pip install pipenv
npm install -g pnpm
- uses: actions/download-artifact@v4
with:
name: ${{ env.artifact_name }}
- name: install project dependencies
run: pipenv sync --dev
- name: manage.py --help
run: |
chmod +x ./src/manage.py
pipenv run ./src/manage.py --help
- name: pytest
run: pipenv run pytest