-
Notifications
You must be signed in to change notification settings - Fork 20
91 lines (85 loc) · 3.13 KB
/
relayer.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
name: Relayer
on:
push:
branches:
- develop
- main
pull_request:
jobs:
relayer_run_unit_tests:
name: Run Unit Tests ${{ matrix.test-type.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-type:
- name: test-unit-go
id: unit
- name: test-unit-go-race
id: race
- name: test-integration-go
id: integration
steps:
- name: Collect Metrics
if: matrix.test-type.id != 'race'
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d9da21a2747016b3e13de58c7d4115a3d5c97935 # v3.0.1
with:
id: starknet-relay-unit-${{ matrix.test-type.id }}
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: Run Unit Tests ${{ matrix.test-type.name }}
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build
run: nix develop -c sh -c "make build-go-relayer"
- name: Run ${{ matrix.test-type.name }}
run: nix develop -c sh -c "make ${{ matrix.test-type.name }} LOG_PATH=/tmp/gotest.log"
- name: Upload Golangci relayer results
if: always()
uses: actions/upload-artifact@v4
with:
name: go-unit-tests-results-${{ matrix.test-type.id }}
path: |
/tmp/gotest.log
./relayer/output.txt
./relayer/coverage.txt
./relayer/race_coverage.txt
check-tidy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "relayer/go.mod"
- name: Setup GitHub Token
id: setup-github-token
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
with:
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.GATI_RELENG_LAMBDA_URL }}
aws-region: ${{ secrets.QA_AWS_REGION }}
- name: Setup Go with private repo access
uses: ./.github/actions/setup-github-private-access
with:
gati_token: ${{ steps.setup-github-token.outputs.access-token }}
- name: Ensure "make gomodtidy" has been run
run: |
make gomodtidy
git diff --exit-code
- name: Ensure "make generate" has been run
run: |
make rm-mocked
make generate
git diff --stat --exit-code