|
| 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: ${{ github.ref_type }}" |
| 52 | + make install-tools |
| 53 | + make test-gh-actions |
| 54 | + echo "back to testing workflow yaml" |
| 55 | + echo "github ref name: ${{ github.ref_name }}" |
| 56 | + echo "github ref type: ${{ github.ref_type }}" |
| 57 | + echo "github workspace: ${{ github.workspace }}" |
| 58 | + echo "github ref: ${{ github.ref }}" |
| 59 | + echo "github env: ${{ github.env }}" |
| 60 | + echo "github env workspace: ${{ env.GITHUB_WORKSPACE }}" |
0 commit comments