forked from gabrie30/ghorg
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (69 loc) · 2.42 KB
/
go-build-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
# Running locally https://yonatankra.com/how-to-test-github-actions-locally-using-act/
name: Go
on: pull_request
jobs:
build_and_test:
environment: actions
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v1
with:
go-version: 1.22
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Test
run: go test -v ./...
- name: Build
run: go build -v -o ghorg .
- name: Run GitHub Cloud Integration Tests
run: scripts/github_cloud_integration_tests.sh
env:
GITHUB_TOKEN: ${{ secrets.GHORG_GITHUB_TOKEN }}
- name: Run Bitbucket Cloud Integration Tests
run: scripts/bitbucket_cloud_integration_tests.sh
env:
BITBUCKET_TOKEN: ${{ secrets.GHORG_BITBUCKET_APP_PASSWORD }}
BITBUCKET_USERNAME: ${{ secrets.GHORG_BITBUCKET_USERNAME }}
- name: Run GitLab Cloud Integration Tests
run: scripts/gitlab_cloud_integration_tests.sh
env:
GITLAB_TOKEN: ${{ secrets.GHORG_GITLAB_TOKEN }}
build_and_test_windows:
environment: actions
name: Build and Test Windows
runs-on: windows-latest
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v1
with:
go-version: 1.22
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set configuration file
run: |
mkdir C:\Users\runneradmin\.config\ghorg
copy sample-conf.yaml C:\Users\runneradmin\.config\ghorg\conf.yaml
- name: Build
run: env GOOS=windows GOARCH=386 go build -v -o ghorg.exe .
- name: Test
run: go test -v ./...
- name: Run GitHub Integration Tests
run: scripts/windows_github_integration_tests.bat
env:
GITHUB_TOKEN: ${{ secrets.GHORG_GITHUB_TOKEN }}
- name: Run Bitbucket Integration Tests
run: scripts/bitbucket_cloud_integration_tests.sh
env:
BITBUCKET_TOKEN: ${{ secrets.GHORG_BITBUCKET_APP_PASSWORD }}
BITBUCKET_USERNAME: ${{ secrets.GHORG_BITBUCKET_USERNAME }}
- name: Run GitLab Cloud Integration Tests
run: scripts/gitlab_cloud_integration_tests.sh
env:
GITLAB_TOKEN: ${{ secrets.GHORG_GITLAB_TOKEN }}