Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to make mediasoup-worker-prebuild CI task only run in releases #1280

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ "v3" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "v3" ]
schedule:
- cron: '37 9 * * 5'
on: [push, pull_request]

concurrency:
# Cancel a currently running workflow from the same PR, branch or tag when a
# new workflow is triggered.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
analyze:
Expand All @@ -32,8 +31,8 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
language: [ "cpp", "javascript", "python" ]
# CodeQL supports [ "cpp", "csharp", "go", "java", "javascript", "python", "ruby" ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

env:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/mediasoup-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
ci:
strategy:
matrix:
fail-fast: true
ci:
- os: ubuntu-20.04
node: 16
Expand All @@ -27,7 +28,7 @@ jobs:
runs-on: ${{ matrix.ci.os }}

env:
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: "true"

steps:
- name: Checkout
Expand All @@ -43,7 +44,7 @@ jobs:
with:
path: |
~/.npm
key: ${{ matrix.ci.os }}-node-${{ hashFiles('**/package.json') }}
key: ${{ matrix.ci.os }}-node-${{ hashFiles("**/package.json") }}
restore-keys: |
${{ matrix.ci.os }}-node-

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/mediasoup-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
jobs:
ci:
strategy:
fail-fast: true
matrix:
os:
- ubuntu-20.04
Expand All @@ -24,7 +25,7 @@ jobs:
runs-on: ${{ matrix.os }}

env:
KEEP_BUILD_ARTIFACTS: '1'
KEEP_BUILD_ARTIFACTS: "1"

steps:
- name: Checkout
Expand All @@ -36,7 +37,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
key: ${{ matrix.os }}-cargo-${{ hashFiles("**/Cargo.toml") }}

- name: cargo fmt
run: cargo fmt --all -- --check
Expand All @@ -50,6 +51,6 @@ jobs:
- name: cargo doc
run: cargo doc --locked --all --no-deps --lib
env:
DOCS_RS: '1'
RUSTDOCFLAGS: '-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links'
DOCS_RS: "1"
RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links"

11 changes: 10 additions & 1 deletion .github/workflows/mediasoup-worker-prebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: mediasoup-worker-prebuild

on:
push:
branches:
- v3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add v3 branch if you only want to run this workflow on releases? I believe these conditions are additive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did assuming they are not additive...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Only trigger for production releases.
tags:
- "*.*.*"
Expand All @@ -15,7 +17,7 @@ on:
jobs:
ci:
strategy:
fail-fast: false
fail-fast: true
matrix:
build:
# For Linux let's use an old version of Ubuntu (20.04) that builds the
Expand Down Expand Up @@ -44,29 +46,36 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
if: startsWith(github.ref, "refs/tags/")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not skipping the whole workflow instead? Skipping individual steps looks odd

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not skipping the whole workflow instead?

How to do that? 😀
That's exactly what I've been trying to do.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is if at job level as well: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif

But if job is only triggered by tag, this check doesn't have any effect in the first place.


- name: Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
if: startsWith(github.ref, "refs/tags/")

# We need to install some NPM production deps for npm-scripts.mjs to work.
- name: npm ci --ignore-scripts
run: npm ci --ignore-scripts --omit=dev --foreground-scripts
if: startsWith(github.ref, "refs/tags/")

# However we also need to install pip invoke manually (since
# `--ignore-scripts` prevented invoke from being installed).
- name: pip3 install invoke
run: pip3 install invoke
if: startsWith(github.ref, "refs/tags/")

- name: npm run worker:build
run: npm run worker:build
if: startsWith(github.ref, "refs/tags/")

# Publish prebuild binaries on tag.
- name: npm run worker:prebuild
run: npm run worker:prebuild
if: startsWith(github.ref, "refs/tags/")

- name: Upload mediasoup-worker prebuilt binary
uses: softprops/action-gh-release@v1
with:
files: worker/prebuild/mediasoup-worker-*.tgz
if: startsWith(github.ref, "refs/tags/")
12 changes: 6 additions & 6 deletions .github/workflows/mediasoup-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
jobs:
ci:
strategy:
fail-fast: false
fail-fast: true
matrix:
build:
- os: ubuntu-20.04
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
env:
CC: ${{ matrix.build.cc }}
CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: 'true'
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: "true"

steps:
- name: Checkout
Expand All @@ -60,7 +60,7 @@ jobs:
with:
path: |
~/.npm
key: ${{ matrix.build.os }}-node-${{matrix.build.cc}}-${{ hashFiles('**/package.json') }}
key: ${{ matrix.build.os }}-node-${{matrix.build.cc}}-${{ hashFiles("**/package.json") }}
restore-keys: |
${{ matrix.build.os }}-node-${{matrix.build.cc}}-

Expand All @@ -72,17 +72,17 @@ jobs:
- name: npm ci --prefix worker/scripts
run: npm ci --prefix worker/scripts --foreground-scripts
# TODO: Maybe fix this one day.
if: runner.os != 'Windows'
if: runner.os != "Windows"

- name: invoke -r worker lint
run: invoke -r worker lint
# TODO: Maybe fix this one day.
if: runner.os != 'Windows'
if: runner.os != "Windows"

- name: invoke -r worker mediasoup-worker
run: invoke -r worker mediasoup-worker

- name: invoke -r worker test
run: invoke -r worker test
# TODO: Maybe fix this one day.
if: runner.os != 'Windows'
if: runner.os != "Windows"