|
73 | 73 | go-lint \ |
74 | 74 | ; |
75 | 75 | 'shell': 'bash' |
76 | | - - 'name': 'Set up Node' |
77 | | - 'uses': 'actions/setup-node@v1' |
| 76 | + - 'uses': 'actions/setup-node@v7' |
78 | 77 | 'with': |
79 | 78 | 'node-version': '${{ env.NODE_VERSION }}' |
80 | | - - 'name': 'Get npm cache directory' |
81 | | - 'id': 'npm-cache' |
82 | | - 'run': 'echo "::set-output name=dir::$( npm config get cache )"' |
83 | | - - 'name': 'Set up npm cache' |
84 | | - 'uses': 'actions/cache@v4' |
85 | | - 'with': |
86 | | - 'path': '${{ steps.npm-cache.outputs.dir }}' |
87 | | - 'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}" |
88 | | - 'restore-keys': '${{ runner.os }}-node-' |
89 | 79 | - 'name': 'Run tests' |
90 | 80 | 'shell': 'bash' |
91 | 81 | 'run': | |
92 | 82 | #!/bin/sh |
93 | 83 |
|
94 | 84 | set -e -f -u -x |
95 | 85 | make \ |
96 | | - CLIENT_DIR=client \ |
| 86 | + CLIENT_DIR=${{ env.CLIENT_DIR }} \ |
97 | 87 | VERBOSE=1 \ |
98 | 88 | deps \ |
99 | 89 | test \ |
|
106 | 96 | 'with': |
107 | 97 | 'token': '${{ secrets.CODECOV_TOKEN }}' |
108 | 98 | 'file': './cover.out' |
109 | | - # TODO(d.kolyshev): !! Build snapshot. |
| 99 | + 'BuildSnapshot': |
| 100 | + 'if': | |
| 101 | + ${{ github.repository_owner != 'AdGuardSoftwareLimited' }} |
| 102 | + 'needs': 'TestJob' |
| 103 | + 'permissions': |
| 104 | + 'contents': 'read' |
| 105 | + 'runs-on': 'ubuntu-latest' |
| 106 | + 'steps': |
| 107 | + - 'uses': 'actions/checkout@v6' |
| 108 | + 'with': |
| 109 | + # Set fetch-depth for correct version parsing. |
| 110 | + 'fetch-depth': '0' |
| 111 | + # Set to false to avoid GITHUB_TOKEN leaking. |
| 112 | + # |
| 113 | + # See https://github.com/actions/checkout/issues/485#issuecomment-934422611. |
| 114 | + 'persist-credentials': false |
| 115 | + - 'uses': 'actions/setup-go@v6' |
| 116 | + 'with': |
| 117 | + 'go-version': '${{ env.GO_VERSION }}' |
| 118 | + - 'name': 'Set up Go modules cache' |
| 119 | + 'uses': 'actions/cache@v4' |
| 120 | + 'with': |
| 121 | + 'path': '~/go/pkg/mod' |
| 122 | + 'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}" |
| 123 | + 'restore-keys': '${{ runner.os }}-go-' |
| 124 | + - 'uses': 'actions/setup-node@v7' |
| 125 | + 'with': |
| 126 | + 'node-version': '${{ env.NODE_VERSION }}' |
| 127 | + - 'name': 'Set up Snapcraft' |
| 128 | + 'run': | |
| 129 | + #!/bin/sh |
| 130 | +
|
| 131 | + set -e -f -u -x |
| 132 | +
|
| 133 | + sudo snap install snapcraft --classic |
| 134 | + - 'name': 'Set up QEMU' |
| 135 | + 'uses': 'docker/setup-qemu-action@v3' |
| 136 | + - 'name': 'Set up Docker Buildx' |
| 137 | + 'uses': 'docker/setup-buildx-action@v3' |
| 138 | + 'with': |
| 139 | + 'install': true |
| 140 | + - 'name': 'Run snapshot build' |
| 141 | + 'run': | |
| 142 | + #!/bin/sh |
| 143 | +
|
| 144 | + set -e -f -u -x |
| 145 | +
|
| 146 | + make \ |
| 147 | + CLIENT_DIR=${{ env.CLIENT_DIR }} \ |
| 148 | + SIGN=0 \ |
| 149 | + VERBOSE=1 \ |
| 150 | + build-release \ |
| 151 | + build-docker \ |
| 152 | + ; |
110 | 153 | 'name': 'Lint and test workflow' |
111 | 154 | 'on': |
112 | 155 | 'push': |
|
0 commit comments