File tree 3 files changed +79
-0
lines changed
internal/buildscripts/packaging/temp-gh-actions-test
3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : actions-test-playground
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' test_actions*'
7
+ pull_request :
8
+ paths :
9
+ - ' .github/workflows/actions-test-playground.yml'
10
+ - ' internal/buildscripts/packaging/temp-gh-actions-test/**'
11
+ - ' Makefile'
12
+
13
+ concurrency :
14
+ group : actions-test-playground-${{ github.event.pull_request.number || github.ref }}
15
+ cancel-in-progress : true
16
+
17
+ env :
18
+ PYTHON_VERSION : ' 3.10'
19
+ PIP_VERSION : ' 22.0.4'
20
+ GO_VERSION : 1.19.0
21
+
22
+ jobs :
23
+ setup-environment :
24
+ name : setup-environment
25
+ # Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
26
+ runs-on : ubuntu-20.04
27
+ steps :
28
+ - name : Check out the codebase.
29
+ uses : actions/checkout@v3
30
+
31
+ - name : Set up Go
32
+ uses : actions/setup-go@v3
33
+ with :
34
+ go-version : ${{ env.GO_VERSION }}
35
+
36
+ - name : Caching dependency
37
+ uses : actions/cache@v3
38
+ with :
39
+ path : |
40
+ ~/.cache/go-build
41
+ ~/go/pkg/mod
42
+ ~/go/bin
43
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
44
+
45
+ - name : Test env vars
46
+ run : |
47
+ echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE"
48
+ echo "GITHUB_REF_NAME=$GITHUB_REF_NAME"
49
+ echo "REF_TYPE=$REF_TYPE"
50
+ echo "github ref name: ${{ github.ref_name }}"
51
+ echo "github ref type: ${{ payload.ref_type }}"
52
+ echo "github ref type: ${{ payload.ref_type }}"
53
+
54
+ make install-tools
55
+ make test-gh-actions
Original file line number Diff line number Diff line change @@ -225,3 +225,17 @@ endif
225
225
.PHONY : update-examples
226
226
update-examples :
227
227
cd examples && $(MAKE ) update-examples
228
+
229
+ .PHONY : test-gh-actions
230
+ test-gh-actions :
231
+ echo " In makefile for github actions"
232
+ echo " $( GITHUB_WORKSPACE) "
233
+ echo " $( GITHUB_REF) "
234
+ echo " $( GITHUB_REF_NAME) "
235
+ echo " $( REF_TYPE) "
236
+ echo " $( VERSION) "
237
+ ./internal/buildscripts/packaging/temp-gh-actions-test/test-gh-actions-shell-script.sh
238
+ # Would be surprised if these worked at all
239
+ echo "github ref name : ${{ github.ref_name }}"
240
+ echo "github ref type : ${{ payload.ref_type }}"
241
+ echo "github ref type : ${{ payload.ref_type }}"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ echo " starting tests!"
3
+ set -euxo pipefail
4
+ # Tests that github actions env vars are set as expected. Likely to fail on first few pushes, as we will be validating
5
+ # an error case to start with.
6
+
7
+ echo " GITHUB_WORKSPACE=$GITHUB_WORKSPACE "
8
+ echo " GITHUB_REF_NAME=$GITHUB_REF_NAME "
9
+ # echo "REF_TYPE=$REF_TYPE"
10
+ echo " exiting test.."
You can’t perform that action at this time.
0 commit comments