Skip to content

Commit

Permalink
Upgrade to 2021 Rust edition (#16)
Browse files Browse the repository at this point in the history
- upgrade to 1.58 stable Rust
- harden rustc and Clippy lints
- upgrade Cargo deps

Additionally:
- remove `MEDEA_TAG` parsing from commit message on CI
- upgrade Chrome for E2E tests to 97.0 version

Co-authored-by: evdokimovs <evdokimovs@protonmail.ch>
  • Loading branch information
tyranron and evdokimovs authored Jan 17, 2022
1 parent 6de6878 commit ad921e3
Show file tree
Hide file tree
Showing 186 changed files with 4,143 additions and 3,757 deletions.
15 changes: 15 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ doc-valid-idents = [
"MediaStreamTrack", "MediaStreamTrackState",
"MediaTrackConstraints",
"MessageEvent",
"RESTful",
"RTCAudioSenderStats", "RTCSenderAudioTrackAttachmentStats",
"RTCConfiguration",
"RTCDataChannel",
Expand All @@ -35,3 +36,17 @@ doc-valid-idents = [
"VideoFacingModeEnum",
"WebAPI", "WebDriver", "WebRTC", "WebSocket",
]

standard-macro-braces = [
{ name = "assert", brace = "(" },
{ name = "assert_eq", brace = "(" },
{ name = "assert_ne", brace = "(" },
{ name = "format", brace = "(" },
{ name = "format_ident", brace = "(" },
{ name = "json", brace = "(" },
{ name = "matches", brace = "(" },
{ name = "parse_quote", brace = "{" },
{ name = "quote", brace = "{" },
{ name = "Token", brace = "[" },
{ name = "vec", brace = "[" },
]
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!Cargo.toml
!Cargo.lock
!src/
!README.md

# Project sub-crates.
!crates/
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ on:
pull_request:
branches: ["master"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
MEDEA_BRANCH: edge # for E2E tests only
RUST_BACKTRACE: 1

jobs:
Expand Down Expand Up @@ -166,7 +171,7 @@ jobs:

test-e2e:
name: E2E tests
needs: ['docker']
needs: ["docker"]
if: ${{ github.ref == 'refs/heads/master'
|| startsWith(github.ref, 'refs/tags/medea-')
|| !contains(github.event.head_commit.message, '[skip ci]') }}
Expand Down Expand Up @@ -204,11 +209,6 @@ jobs:
-p ${{ secrets.MEDEA_DOCKER_PASS }}
hub.instrumentisto.com

- name: Set Medea branch name env var
run: echo "MEDEA_BRANCH=$(echo ${{ github.event.head_commit.message }}
| sed -n -e "s/.*\[medea_branch = \(.*\)\]/\1/p"
| grep . || echo "edge")" >> $GITHUB_ENV

- name: Pull edge Medea Docker image
run: docker pull hub.instrumentisto.com/streaming/medea:edge
if: ${{ env.MEDEA_BRANCH == 'edge' }}
Expand Down Expand Up @@ -434,7 +434,7 @@ jobs:

release-github:
name: Release on GitHub
needs: ['clippy', 'rustfmt', 'rustdoc', 'test-e2e', 'test-unit']
needs: ["clippy", "rustfmt", "rustdoc", "test-e2e", "test-unit"]
if: ${{ startsWith(github.ref, 'refs/tags/medea-') }}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -477,7 +477,7 @@ jobs:

release-cargo:
name: Release on crates.io
needs: ['release-github']
needs: ["release-github"]
if: ${{ startsWith(github.ref, 'refs/tags/medea-')
&& !startsWith(github.ref, 'refs/tags/medea-control-api-mock-')
&& !startsWith(github.ref, 'refs/tags/medea-demo-') }}
Expand Down Expand Up @@ -505,7 +505,7 @@ jobs:

release-npm:
name: Release on NPM
needs: ['release-github']
needs: ["release-github"]
if: ${{ startsWith(github.ref, 'refs/tags/medea-jason-') }}
runs-on: ubuntu-latest
steps:
Expand All @@ -517,9 +517,9 @@ jobs:
text: ${{ github.ref }}
regex: '^refs/tags/(medea[a-z-]*)-([0-9]+\.[0-9]+\.[0-9]+(-.+)?)$'

- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v2
with:
node-version: '15'
node-version: "17"
- name: Create NPM authorization
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_TOKEN }}"
> ~/.npmrc
Expand All @@ -540,7 +540,7 @@ jobs:

release-helm:
name: Release Helm chart
needs: ['helm-lint']
needs: ["helm-lint"]
if: ${{ github.ref == 'refs/heads/master' }}
strategy:
matrix:
Expand Down Expand Up @@ -573,7 +573,7 @@ jobs:

release-docker:
name: Release Docker image
needs: ['docker']
needs: ["docker"]
if: ${{ github.ref == 'refs/heads/master'
|| startsWith(github.ref, 'refs/tags/medea-') }}
strategy:
Expand Down Expand Up @@ -680,7 +680,7 @@ jobs:
uses: bluwy/substitute-string-action@v1
with:
_input-text: ${{ matrix.image }}
-edge: ''
-edge: ""
if: ${{ matrix.if }}
# On GitHub Container Registry README is automatically updated on pushes.
- name: Update README on Quay.io
Expand Down
Loading

0 comments on commit ad921e3

Please sign in to comment.