-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (50 loc) · 1.66 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
env:
GOPRIVATE: github.com/platformsh
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
# do not enable cache here, because golangci-linter
# has its own internal cache with better performance
go-version: 1.22.x
- name: Create fake PHP and .phar files
run: |
# These are needed so that the linter does not complain
touch internal/legacy/archives/platform.phar
touch internal/legacy/archives/php_windows_amd64
touch internal/legacy/archives/php_linux_amd64
touch internal/legacy/archives/php_linux_arm64
touch internal/legacy/archives/php_darwin_amd64
touch internal/legacy/archives/php_darwin_arm64
touch internal/config/embedded-config.yaml
- name: Add SSH Go Module Private Key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.GO_MODULE_PRIVATE_KEY }}"
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
- name: Setup access for private go modules
run: |
git config --global url."ssh://git@github.com/".insteadOf https://github.com/
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.59
- name: Run tests
run: make test