-
Notifications
You must be signed in to change notification settings - Fork 5
86 lines (72 loc) · 2.43 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
79
80
81
82
83
84
85
86
name: CCIP2ETH Test
on: [workflow_dispatch, push]
env:
FOUNDRY_PROFILE: ci
jobs:
check:
strategy:
fail-fast: true
name: CCIP2.ETH Resolver Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build
run: |
forge install foundry-rs/forge-std --no-commit --no-git
forge build --sizes
id: build
- name: Run Forge tests
run: |
forge test --fork-url https://rpc.ankr.com/eth_goerli -vvvv --fork-block-number 8897000
id: test
- name: Initialise status badge
if: github.ref == 'refs/heads/main'
run: cp .github/init.svg .github/badge.svg
- name: Set name of badge
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "checks"
replace: "Status"
include: ".github/badge.svg"
regex: false
- name: Capitalise test status
run: |
echo "STATUS=$(echo "${{ steps.test.outcome }}" | sed 's/\b./\U&/')" >> ${GITHUB_ENV}
- name: Set status of Forge tests
if: github.ref == 'refs/heads/main'
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "status"
replace: "${{ env.STATUS }}"
#replace: ${{ (steps.test.outcome == 'success' && 'Ser! 🥳') || 'Ser? ❌' }}
include: ".github/badge.svg"
regex: false
- name: Set color of outcome
if: github.ref == 'refs/heads/main' && steps.test.outcome == 'failure'
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "3C1"
replace: "F73"
include: ".github/badge.svg"
regex: false
- name: Commit changes to .github/badge.svg
if: github.ref == 'refs/heads/main'
uses: EndBug/add-and-commit@v8
with:
author_name: sshmatrix
author_email: [email protected]
message: auto-commit; render badge.svg
add: '.github/badge.svg'
- name: Push changes to .github/badge.svg
if: github.ref == 'refs/heads/main'
uses: ad-m/[email protected]
with:
branch: main
force: true
github_token: ${{ secrets.TOKEN }}