Repository: kubernetes-sigs/security-profiles-operator
Pull request #304 (2021-02-15 15:10:58)

Move test related GitHub actions into one workflow
#### What type of PR is this?

/kind cleanup


#### What this PR does / why we need it:
This cleans the test related GitHub actions by moving them together and
reducing some overhead.
#### Which issue(s) this PR fixes:

<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.

Fixes #

or

None
-->
None
#### Does this PR have test?
None
<!--
If tests aren't applicable just write N/A.
-->

#### Special notes for your reviewer:
None
#### Does this PR introduce a user-facing change?

<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".

For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note
None
```


k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/304#" title="Author self-approved">saschagrunert</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fsecurity-profiles-operator).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/security-profiles-operator/blob/master/OWNERS)~~ [saschagrunert]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
saschagrunert: /assign @JAORMX 
After that one I'd like to pre-build the container image and pass it as artifact to the e2e job. This should speed-up things, too.
JAORMX: /lgtm

Patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
deleted file mode 100644
index 9af6de97b..000000000
--- a/.github/workflows/codeql-analysis.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning
-name: "CodeQL"
-
-on:
-  push:
-    branches: [ master ]
-  pull_request:
-    # The branches below must be a subset of the branches above
-    branches: [ master ]
-  schedule:
-    - cron: '44 12 * * 4'
-
-jobs:
-  analyze:
-    name: Analyze
-    runs-on: ubuntu-latest
-
-    strategy:
-      fail-fast: false
-      matrix:
-        language: [ 'go' ]
-
-    steps:
-    - name: Checkout repository
-      uses: actions/checkout@v2
-
-    # Initializes the CodeQL tools for scanning.
-    - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
-      with:
-        languages: ${{ matrix.language }}
-    - name: Autobuild
-      uses: github/codeql-action/autobuild@v1
-
-    - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1


Test patch:
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
deleted file mode 100644
index 7fd7a4889..000000000
--- a/.github/workflows/e2e.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: e2e
-on:
-  push:
-    branches:
-      - master
-  pull_request:
-jobs:
-  test:
-    runs-on: macos-10.15
-    timeout-minutes: 40
-    env:
-      RUN: ./hack/ci/run.sh
-    steps:
-      - uses: actions/checkout@v2
-      - name: Boot Virtual Machine
-        run: |
-          ln -sf hack/ci/Vagrantfile .
-          vagrant up
-      - name: Show environment information
-        run: $RUN kubectl get nodes -o wide
-      - name: Run E2E tests
-        run: $RUN hack/ci/e2e.sh
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index c90a77ce7..c990d604b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,28 +1,50 @@
-# Inlcuding the tests with ubuntu to get actual test coverage. The OSX builds skip seccomp tests.
-name: test-coverage
+name: test
 on:
   push:
     branches:
       - master
   pull_request:
 jobs:
-  validate:
-    name: Validate 
+  analyze:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
-      - name: Setup Go
-        uses: actions/setup-go@v2
+      - uses: github/codeql-action/init@v1
+        with:
+          languages: go
+      - uses: github/codeql-action/autobuild@v1
+      - uses: github/codeql-action/analyze@v1
+
+  coverage:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: actions/setup-go@v2
         with:
           go-version: '1.15'
       - name: Install libseccomp-dev
         run: |
           sudo apt update
           sudo apt install -y libseccomp-dev
-      - name: unit test
-        run: make test-unit
+      - run: make test-unit
       - uses: codecov/codecov-action@v1
         with:
           files: build/coverage.out
-          flags: unittests 
-          verbose: true 
+          flags: unittests
+          verbose: true
+
+  e2e:
+    runs-on: macos-10.15
+    timeout-minutes: 40
+    env:
+      RUN: ./hack/ci/run.sh
+    steps:
+      - uses: actions/checkout@v2
+      - name: Boot Virtual Machine
+        run: |
+          ln -sf hack/ci/Vagrantfile .
+          vagrant up
+      - name: Show environment information
+        run: $RUN kubectl get nodes -o wide
+      - name: Run E2E tests
+        run: $RUN hack/ci/e2e.sh