Skip to content

Commit

Permalink
Modify time consuming PR workflows to not trigger for drafts
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasberglund committed May 24, 2024
1 parent 92e9b0f commit a7ec500
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/android-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Android - Build and test
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**'
- '!.github/workflows/**'
Expand Down Expand Up @@ -49,6 +50,7 @@ on:
jobs:
prepare:
name: Prepare
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -68,6 +70,7 @@ jobs:

generate-debug-keystore:
name: Generate debug keystore
if: github.event.pull_request.draft == false
needs: prepare
runs-on: ubuntu-latest
steps:
Expand All @@ -93,6 +96,7 @@ jobs:

generate-relay-list:
name: Generate relay list
if: github.event.pull_request.draft == false
needs: prepare
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -137,6 +141,7 @@ jobs:

build-native:
name: Build native
if: github.event.pull_request.draft == false
needs: prepare
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -209,6 +214,7 @@ jobs:

run-lint-and-tests:
name: Run lint and test tasks
if: github.event.pull_request.draft == false
needs: [prepare]
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -248,6 +254,7 @@ jobs:

build-app:
name: Build app
if: github.event.pull_request.draft == false
needs: [prepare, generate-debug-keystore]
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -340,6 +347,7 @@ jobs:

build-instrumented-tests:
name: Build instrumented test packages
if: github.event.pull_request.draft == false
needs: [prepare, generate-debug-keystore]
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -393,6 +401,7 @@ jobs:

instrumented-tests:
name: Run instrumented tests
if: github.event.pull_request.draft == false
runs-on: [self-hosted, android-device]
timeout-minutes: 30
needs: [build-app, build-instrumented-tests]
Expand Down Expand Up @@ -458,7 +467,9 @@ jobs:
instrumented-e2e-tests:
name: Run instrumented e2e tests
runs-on: [self-hosted, android-device]
if: github.event_name == 'schedule' || github.event.inputs.run_e2e_tests == 'true'
if: >
github.event.pull_request.draft == false &&
(github.event_name == 'schedule' || github.event.inputs.run_e2e_tests == 'true')
timeout-minutes: 30
needs: [build-app, build-instrumented-tests]
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/android-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Android - Audit dependencies
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/android-audit.yml
- android/gradle/verification-metadata.xml
Expand All @@ -23,6 +24,7 @@ on:
jobs:
prepare:
name: Prepare
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -42,6 +44,7 @@ jobs:
container_image: ${{ env.inner_container_image }}

owasp-dependency-check:
if: github.event.pull_request.draft == false
needs: prepare
runs-on: ubuntu-latest
container:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/android-kotlin-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Android - Check kotlin formatting
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths: [.github/workflows/android-kotlin-format-check.yml, android/**/*.kt]
workflow_dispatch:
inputs:
Expand All @@ -12,6 +13,7 @@ on:
jobs:
prepare:
name: Prepare
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -31,6 +33,7 @@ jobs:
container_image: ${{ env.inner_container_image }}

check-formatting:
if: github.event.pull_request.draft == false
needs: prepare
runs-on: ubuntu-latest
container:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Rust - Run Clippy to check lints
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/clippy.yml
- clippy.toml
Expand All @@ -10,6 +11,7 @@ on:
jobs:
prepare-android:
name: Prepare Android container
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -30,6 +32,7 @@ jobs:

clippy-check-desktop:
name: Clippy linting, desktop
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
Expand Down Expand Up @@ -69,6 +72,7 @@ jobs:
clippy-check-android:
name: Clippy linting, Android
if: github.event.pull_request.draft == false
needs: prepare-android
runs-on: ubuntu-latest
container:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/daemon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Daemon+CLI - Build and test
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**'
- '!**/**.md'
Expand Down Expand Up @@ -31,6 +32,7 @@ on:
required: false
jobs:
prepare-linux:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -50,6 +52,7 @@ jobs:
container_image: ${{ env.inner_container_image }}

build-linux:
if: github.event.pull_request.draft == false
needs: prepare-linux
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -81,6 +84,7 @@ jobs:
run: ./ci/check-rust.sh

build-macos:
if: github.event.pull_request.draft == false
runs-on: macos-latest
steps:
- name: Checkout repository
Expand All @@ -106,6 +110,7 @@ jobs:
run: ./ci/check-rust.sh

build-windows:
if: github.event.pull_request.draft == false
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Desktop frontend
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/frontend.yml
- gui/**
Expand All @@ -10,6 +11,7 @@ on:

jobs:
check-frontend:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: iOS app
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/ios.yml
- ios/build-rust-library.sh
Expand All @@ -12,6 +13,7 @@ on:
jobs:
check-formatting:
name: Check formatting
if: github.event.pull_request.draft == false
runs-on: macos-13
steps:
- name: Install SwiftFormat
Expand All @@ -30,6 +32,7 @@ jobs:

swiftlint:
name: Run swiftlint
if: github.event.pull_request.draft == false
runs-on: macos-13
steps:
- name: Checkout repository
Expand All @@ -44,6 +47,7 @@ jobs:

test:
name: Unit tests
if: github.event.pull_request.draft == false
runs-on: macos-13-xlarge
env:
SOURCE_PACKAGES_PATH: .spm
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/rust-unused-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Rust - Unused dependencies
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/rust-unused-dependencies.yml
- '**/*.rs'
Expand All @@ -13,6 +14,7 @@ env:
RUST_NIGHTLY_TOOLCHAIN: nightly-2024-02-06
jobs:
prepare-containers:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -27,6 +29,7 @@ jobs:
container_image_android: ${{ env.inner_container_image_android }}

cargo-udeps-linux:
if: github.event.pull_request.draft == false
needs: prepare-containers
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -58,6 +61,7 @@ jobs:
run: source env.sh && cargo udeps --workspace

cargo-udeps-android:
if: github.event.pull_request.draft == false
needs: prepare-containers
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -85,6 +89,7 @@ jobs:
run: cargo udeps --target aarch64-linux-android --package mullvad-jni

cargo-udeps:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [macos-latest, windows-latest]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/testframework-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: DES Testframework - Clippy
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'test/**/*.rs'
- .github/workflows/clippy-test.yml
Expand All @@ -11,6 +12,7 @@ on:
jobs:
clippy-check-test:
name: Clippy linting of test workspace
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -48,6 +50,7 @@ jobs:
clippy-check-test-windows:
name: Clippy linting of test workspace (Windows)
if: github.event.pull_request.draft == false
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/testframework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: DES Testframework - Build
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**'
- '!**/**.md'
Expand All @@ -26,6 +27,7 @@ on:
workflow_dispatch:
jobs:
prepare-build-test-framework-linux:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -46,6 +48,7 @@ jobs:

# Build the test runner + test manager at once.
build-test-framework-linux:
if: github.event.pull_request.draft == false
needs: prepare-build-test-framework-linux
runs-on: ubuntu-latest
container:
Expand All @@ -69,6 +72,7 @@ jobs:

# Build the test runner + test manager at once.
build-test-framework-macos:
if: github.event.pull_request.draft == false
runs-on: macos-latest
steps:
- name: Checkout repository
Expand All @@ -91,6 +95,7 @@ jobs:

# Build only the test-runner binary on Windows. Windows is not a supported host for test-manager.
build-test-runner-windows:
if: github.event.pull_request.draft == false
# Cross-compile the test runner for Windows from Linux.
needs: prepare-build-test-framework-linux
runs-on: ubuntu-latest
Expand Down

0 comments on commit a7ec500

Please sign in to comment.