nightly-build #492
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nightly-build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '14 1 * * *' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: [stable, beta] | |
os: [ubuntu-20.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_TERM_COLOR: always | |
IPINFO_API_TOKEN: ${{ secrets.IPINFO_API_TOKEN }} | |
continue-on-error: true | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install Dependencies (Linux) | |
run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler | |
if: matrix.os == 'ubuntu-20.04' | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
components: rustfmt, clippy | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest' | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check formatting | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Build binaries | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --workspace | |
- name: Build examples | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --workspace --examples | |
# To avoid running out of disk space, skip generating debug symbols | |
- name: Set debug to false (unix) | |
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-latest' | |
run: | | |
sed -i.bak 's/\[profile.dev\]/\[profile.dev\]\ndebug = false/' Cargo.toml | |
git diff | |
- name: Set debug to false (win) | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
(Get-Content Cargo.toml) -replace '\[profile.dev\]', "`$&`ndebug = false" | Set-Content Cargo.toml | |
git diff | |
- name: Run unit tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace | |
- name: Run slow unit tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace -- --ignored | |
- name: Clean | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clean | |
- name: Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --workspace --all-targets -- -D warnings | |
notification: | |
needs: build | |
runs-on: custom-linux | |
steps: | |
- name: Collect jobs status | |
uses: technote-space/workflow-conclusion-action@v3 | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: install npm | |
uses: actions/setup-node@v4 | |
if: env.WORKFLOW_CONCLUSION == 'failure' | |
with: | |
node-version: 18 | |
- name: Matrix - Node Install | |
if: env.WORKFLOW_CONCLUSION == 'failure' | |
run: npm install | |
working-directory: .github/workflows/support-files | |
- name: Matrix - Send Notification | |
if: env.WORKFLOW_CONCLUSION == 'failure' | |
env: | |
NYM_NOTIFICATION_KIND: nightly | |
NYM_PROJECT_NAME: "Nym nightly build" | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
GIT_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}" | |
GIT_BRANCH: "${GITHUB_REF##*/}" | |
IS_SUCCESS: "${{ env.WORKFLOW_CONCLUSION == 'success' }}" | |
MATRIX_SERVER: "${{ secrets.MATRIX_SERVER }}" | |
MATRIX_ROOM: "${{ secrets.MATRIX_ROOM_NIGHTLY }}" | |
MATRIX_USER_ID: "${{ secrets.MATRIX_USER_ID }}" | |
MATRIX_TOKEN: "${{ secrets.MATRIX_TOKEN }}" | |
MATRIX_DEVICE_ID: "${{ secrets.MATRIX_DEVICE_ID }}" | |
uses: docker://keybaseio/client:stable-node | |
with: | |
args: .github/workflows/support-files/notifications/entry_point.sh |