-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (149 loc) · 6.16 KB
/
Copy pathci.yml
File metadata and controls
156 lines (149 loc) · 6.16 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- '**.png'
- '**.md'
- 'LICENSE*'
- '.git*'
- '.envrc'
- 'garnix.yaml'
- '.github/workflows/cd.yml'
workflow_dispatch:
permissions:
pull-requests: write
contents: read
issues: write
checks: read
statuses: read
jobs:
coverage:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: | # TODO Ensure nix uses the most performant cache between Garnix and Cachix every time
extra-substituters = https://cache.garnix.io
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- uses: cachix/cachix-action@v17
with:
name: gfauredev
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: sleep 5 # Sleep hoping Garnix evaluation will start after
- uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-regexp: 'Evaluate flake.nix'
repo-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-no-checks: false
allowed-conclusions: success,failure,cancelled,skipped,timed_out,neutral
- uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-regexp: 'check coverage.*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-no-checks: false
allowed-conclusions: success,failure,cancelled,skipped,timed_out,neutral
- run: nix build .#checks.x86_64-linux.coverage -o coverage # From Garnix
- run: .script/coverage-report.sh
id: coverage_report
- if: always() && github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
### 📊 Coverage Report
**Lines: ${{ steps.coverage_report.outputs.COVERED }}/${{ steps.coverage_report.outputs.TOTAL }} (${{ steps.coverage_report.outputs.PERCENT }}%)**
⏱️ Tests: ${{ steps.coverage_report.outputs.TESTS_COUNT }} tests in ${{ steps.coverage_report.outputs.DURATION }}s
${{ steps.coverage_report.outputs.REPORT }}
- run: exit "${{ steps.coverage_report.outputs.FAIL }}"
android-build:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
checks: read # Required by wait-on-check-action
statuses: read # Required by wait-on-check-action
steps:
- uses: actions/checkout@v6
with:
lfs: true
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
extra-substituters = https://cache.garnix.io
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- uses: cachix/cachix-action@v17
with:
name: gfauredev
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: sleep 5 # Sleep hoping Garnix evaluation will start after
- uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-regexp: 'Evaluate flake.nix'
repo-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-no-checks: false
allowed-conclusions: success,failure,cancelled,skipped,timed_out,neutral
- uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-regexp: 'package androidBuild.*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-no-checks: false
allowed-conclusions: success,failure,cancelled,skipped,timed_out,neutral
- uses: timheuer/base64-to-file@v1.2.4
with:
fileName: 'logout.jks'
encodedString: ${{ secrets.ANDROID_KEYSTORE_B64 }}
id: keystore
- run: nix run .#androidBuild
env:
ANDROID_KEYSTORE_PATH: ${{ steps.keystore.outputs.filePath }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
- uses: actions/upload-artifact@v4
with: { name: android, path: '*.apk' }
# e2e-web: # Moved to CD to run against the public preview URL on Pages deploy
# if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
# needs: coverage
# runs-on: ubuntu-latest
# timeout-minutes: 40
# steps:
# - uses: actions/checkout@v6
# - uses: cachix/install-nix-action@v31
# with:
# github_access_token: ${{ secrets.GITHUB_TOKEN }}
# extra_nix_config: | # TODO Ensure nix uses the most performant cache between Garnix and Cachix every time
# extra-substituters = https://cache.garnix.io
# extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
# - uses: cachix/cachix-action@v17
# with:
# name: gfauredev
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# - name: Remove system Chrome to prevent version mismatch with nixpkgs chromedriver
# run: sudo apt-get remove -y google-chrome-stable
# - run: |
# set -o pipefail
# nix run .#webE2eTest |& tee maestro_console.log
# - if: failure() && github.event_name == 'pull_request'
# env:
# CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
# CLOUDINARY_UPLOAD_PRESET: ${{ secrets.CLOUDINARY_UPLOAD_PRESET }}
# run: .script/e2e-web-report.sh
# id: upload_screenshots
# - if: failure() && github.event_name == 'pull_request' && steps.upload_screenshots.outputs.REPORT_BODY != ''
# uses: peter-evans/create-or-update-comment@v5
# with:
# issue-number: ${{ github.event.pull_request.number }}
# body: ${{ steps.upload_screenshots.outputs.REPORT_BODY }}
# - if: failure() || cancelled()
# uses: actions/upload-artifact@v7
# with:
# name: maestro-web-report
# path: ~/.maestro/tests/