From 762f1c21fea3c105bf966df5c599af896208ccfd Mon Sep 17 00:00:00 2001 From: Mengxin Liu Date: Thu, 26 Nov 2020 18:04:02 +0800 Subject: [PATCH] ci: specify ubuntu version to make github action happy https://github.com/actions/virtual-environments/issues/1816 (cherry picked from commit e3082cd7727ffd47aeae6af0ea47dabbd397a80e) --- .github/workflows/build-arm64-image.yaml | 2 +- .github/workflows/build-dpdk-image.yaml | 2 +- .github/workflows/build-x86-image.yaml | 10 ++-- .github/workflows/codeql-analysis.yml | 71 ++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/build-arm64-image.yaml b/.github/workflows/build-arm64-image.yaml index 9238b9ce20c..265a6970b17 100644 --- a/.github/workflows/build-arm64-image.yaml +++ b/.github/workflows/build-arm64-image.yaml @@ -17,7 +17,7 @@ on: jobs: build: name: Build arm64 - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Set up Go 1.x uses: actions/setup-go@v2 diff --git a/.github/workflows/build-dpdk-image.yaml b/.github/workflows/build-dpdk-image.yaml index e8617d55be3..7172405da52 100644 --- a/.github/workflows/build-dpdk-image.yaml +++ b/.github/workflows/build-dpdk-image.yaml @@ -17,7 +17,7 @@ on: jobs: build: name: Build DPDK - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/build-x86-image.yaml b/.github/workflows/build-x86-image.yaml index a14e1a11bbe..824c2496979 100644 --- a/.github/workflows/build-x86-image.yaml +++ b/.github/workflows/build-x86-image.yaml @@ -18,7 +18,7 @@ on: jobs: build: name: Build x86 - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Set up Go 1.x uses: actions/setup-go@v2 @@ -78,7 +78,7 @@ jobs: single-e2e: needs: build name: 1-master-e2e - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Check out code uses: actions/checkout@v2 @@ -124,7 +124,7 @@ jobs: ha-e2e: needs: build name: 3-master-e2e - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Check out code uses: actions/checkout@v2 @@ -171,7 +171,7 @@ jobs: ipv6-e2e: needs: build name: ipv6-e2e - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Check out code uses: actions/checkout@v2 @@ -207,7 +207,7 @@ jobs: push: needs: [single-e2e, ha-e2e, ipv6-e2e] name: push - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000000..9e397f39d19 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 17 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-18.04 + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['go'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1