-
Notifications
You must be signed in to change notification settings - Fork 20
53 lines (51 loc) · 1.56 KB
/
pull_request.yaml
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
name: pull_request
on:
push:
branches:
- 'master'
- 'main'
pull_request:
jobs:
test:
name: Tests
runs-on: ubuntu-22.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: google-github-actions/setup-gcloud@a48b55b3b0eeaf77b6e1384aab737fbefe2085ac
with:
version: '290.0.1'
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
name: Gcloud Login
- name: Install Trivy
run: |
wget https://github.com/aquasecurity/trivy/releases/download/v0.18.3/trivy_0.18.3_Linux-64bit.deb
sudo dpkg -i trivy_0.18.3_Linux-64bit.deb
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.CLOUDBUILD_GITHUB_TOKEN }}
TEST_PKG: ./... # Run all tests
run: make test
- uses: testspace-com/setup-testspace@v1
with:
domain: solo-io.testspace.com
if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Push result to Testspace server
run: |
testspace push --verbose "**/junit.xml"
if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/master' }}