-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (81 loc) · 2.43 KB
/
checks.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Checks
on:
push:
pull_request:
workflow_dispatch:
env:
SSH_PUB_KEY:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH9KSzBv3mfRAq7tOOU6/J9htV/+UTwro8q/JkO97HwO [email protected]
GH_BOT_ACC_EMAIL:
69208565+github-actions[bot]@users.noreply.github.com
GH_BOT_ACC_NAME:
github-actions[bot]
jobs:
unittest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Nix cache
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-23.05
- name: Compiles
run: nix build
- name: Run the unittests
run: nix run .#unit_tests
fix_headers:
needs: [ unittest ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Nix cache
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-23.05
- name: Setup Git
run: |
git config --local user.email $GH_BOT_ACC_EMAIL
git config --local user.name $GH_BOT_ACC_NAME
git fetch --unshallow origin
- name: Fix headers
run: |
nix run github:drawpitech/EpiHeader -- --name "lemin"
git add .
git commit -m "Fix headers" || echo "nothing to commit."
git push origin || echo "nothing to push."
coding_style:
needs: [ unittest ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: $SSH_PUB_KEY
- name: Nix cache
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-23.05
- name: Run coding style
run: nix run github:Sigmapitech/cs
mirror:
needs: [ unittest, fix_headers, coding_style ]
if: ${{ !github.event.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: $SSH_PUB_KEY
- name: Push to epitech
run: |
git fetch --unshallow origin
git remote add epitech "${{ secrets.MIRROR_REPO }}"
git push epitech --force