-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.67 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: test
on:
push:
schedule:
- cron: "0 0 * * *"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup_python${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: setup
run: |
pip install -U setuptools wheel pip
pip install pre-commit
- name: pre-commit
run: |
pre-commit run --all-files
canary:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
steps:
- name: setup_python${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: setup
run: |
pip install -U setuptools wheel pip
pip install cruft
- name: cruft
run: |
echo "cruft create \\"
echo " --no-input \\"
echo " --checkout ${{ github.ref_name }} \\"
echo " --extra-context '{\"description\": \"Canary\", \"name\": \"${{ github.event.repository.name }}canary\", \"organization\": \"${{ github.repository_owner }}\", \"repo\": \"github.com/{{cookiecutter.organization}}/{{cookiecutter.name}}\" }' \\"
echo " https://github.com/${{ github.repository }}"
cruft create \
--no-input \
--checkout ${{ github.ref_name }} \
--extra-context '{"description": "Canary", "name": "${{ github.event.repository.name }}canary", "organization": "${{ github.repository_owner }}", "repo": "github.com/{{cookiecutter.organization}}/{{cookiecutter.name}}" }' \
https://github.com/${{ github.repository }}
cd ${{ github.event.repository.name }}canary
git config --global init.defaultBranch main
git init .
git remote add origin https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}canary.git
git add -A
git config user.email ${{ secrets.username }}@users.noreply.github.com
git config user.name ${{ secrets.username }}
git commit -m 'Canary'
- name: push
if: ${{ github.event.repository.name }} == "servicetemplate"
run: |
cd ${{ github.event.repository.name }}canary
git config credential.helper store
(echo protocol=https; echo host=github.com; echo username=pennsignals123; echo password=$(printf '${{ secrets.pat }}' | jq -sRr @uri); echo) | git credential approve
git push -u origin main -f -v