cilium

Форк
0
/
integration-test.yaml 
128 строк · 4.2 Кб
1
name: Integration Tests (ci-integration)
2

3
# Any change in triggers needs to be reflected in the concurrency group.
4
on:
5
  workflow_dispatch:
6
    inputs:
7
      PR-number:
8
        description: "Pull request number."
9
        required: true
10
      context-ref:
11
        description: "Context in which the workflow runs. If PR is from a fork, will be the PR target branch (general case). If PR is NOT from a fork, will be the PR branch itself (this allows committers to test changes to workflows directly from PRs)."
12
        required: true
13
      SHA:
14
        description: "SHA under test (head of the PR branch)."
15
        required: true
16
      extra-args:
17
        description: "[JSON object] Arbitrary arguments passed from the trigger comment via regex capture group. Parse with 'fromJson(inputs.extra-args).argName' in workflow."
18
        required: false
19
        default: '{}'
20
  push:
21
    branches:
22
    - main
23
    - ft/main/**
24
    paths-ignore:
25
    - 'Documentation/**'
26

27
# By specifying the access of one of the scopes, all of those that are not
28
# specified are set to 'none'.
29
permissions:
30
  # To be able to access the repository with actions/checkout
31
  contents: read
32
  # To allow retrieving information from the PR API
33
  pull-requests: read
34
  # To be able to set commit status
35
  statuses: write
36

37
concurrency:
38
  # Structure:
39
  # - Workflow name
40
  # - Event type
41
  # - A unique identifier depending on event type:
42
  #   - schedule: SHA
43
  #   - workflow_dispatch: PR number
44
  #
45
  # This structure ensures a unique concurrency group name is generated for each
46
  # type of testing, such that re-runs will cancel the previous run.
47
  group: |
48
    ${{ github.workflow }}
49
    ${{ github.event_name }}
50
    ${{
51
      (github.event_name == 'push' && github.sha) ||
52
      (github.event_name == 'workflow_dispatch' && github.event.inputs.PR-number)
53
    }}
54
  cancel-in-progress: true
55

56
jobs:
57
  commit-status-start:
58
    if: ${{ github.event_name != 'push' }}
59
    name: Commit Status Start
60
    runs-on: ubuntu-latest
61
    steps:
62
      - name: Set initial commit status
63
        uses: myrotvorets/set-commit-status-action@38f3f27c7d52fb381273e95542f07f0fba301307 # v2.0.0
64
        with:
65
          sha: ${{ inputs.SHA || github.sha }}
66

67
  integration-test:
68
    name: Integration Test
69
    runs-on: ubuntu-20.04
70
    timeout-minutes: 45
71
    steps:
72
      - name: Checkout context ref (trusted)
73
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
74
        with:
75
          ref: ${{ inputs.context-ref || github.sha }}
76
          persist-credentials: false
77

78
      - name: Set Environment Variables
79
        uses: ./.github/actions/set-env-variables
80

81
      - name: Set image tag
82
        id: vars
83
        run: |
84
          if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
85
            SHA="${{ inputs.SHA }}"
86
          else
87
            SHA="${{ github.sha }}"
88
          fi
89
          echo sha=${SHA} >> $GITHUB_OUTPUT
90

91
      # Warning: since this is a privileged workflow, subsequent workflow job
92
      # steps must take care not to execute untrusted code.
93
      - name: Checkout pull request branch (NOT TRUSTED)
94
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
95
        with:
96
          ref: ${{ steps.vars.outputs.sha }}
97
          persist-credentials: false
98

99
      - name: Install Go
100
        uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
101
        with:
102
          # renovate: datasource=golang-version depName=go
103
          go-version: 1.22.0
104

105
      - name: Prepare environment
106
        timeout-minutes: 15
107
        run: |
108
          ./.travis/prepare.sh
109

110
      - name: Run integration tests
111
        timeout-minutes: 60
112
        run: |
113
          export PATH=/usr/local/clang/bin:$PATH
114
          export V=0
115
          export DOCKER_BUILD_FLAGS=--quiet
116
          ./.travis/build.sh
117

118
  commit-status-final:
119
    if: ${{ always() && github.event_name != 'push' }}
120
    name: Commit Status Final
121
    needs: integration-test
122
    runs-on: ubuntu-latest
123
    steps:
124
      - name: Set final commit status
125
        uses: myrotvorets/set-commit-status-action@38f3f27c7d52fb381273e95542f07f0fba301307 # v2.0.0  
126
        with:
127
          sha: ${{ inputs.SHA || github.sha }}
128
          status: ${{ needs.integration-test.result }}
129

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.