Skip to content

shift code around, implement first part of DFS algo #75

shift code around, implement first part of DFS algo

shift code around, implement first part of DFS algo #75

Workflow file for this run

---
# copilot helped a lot here
name: Rust Workflow
on:
pull_request:
branches: ["main", "refactor"]
push:
branches:
- main
workflow_dispatch:
# Allows manual triggering
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
outputs:
release_built: ${{ steps.set-output.outputs.release_built }}
steps:
- name: ⚡ Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v4
- name: Ouput rust version for educational purposes
run: rustup --version
- name: Build binaries in debug mode
run: cargo build
- name: Run tests in debug mode
run: cargo test
- name: Run tests in debug mode for Telegram bot project
run: cargo test -p telegram
build_nightly:
needs: build
runs-on: ubuntu-latest
outputs:
release_built: ${{ steps.set-output.outputs.release_built }}
steps:
- name: ⚡ Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v4
- name: Temporarily modify the rust toolchain version
run: rustup override set nightly
- name: Ouput rust version for educational purposes
run: rustup --version
- name: Build binaries in debug mode
run: cargo build
- name: Run tests in debug mode
run: cargo test
- name: Run tests in debug mode for Telegram bot project
run: cargo test -p telegram
- name: revert the override
run: rustup override set nightly
publish:
if: startsWith(github.ref, 'refs/tags/')
# Check if the branch is main
environment: publishing
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ⚡ Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Login into crates.io
run: cargo login ${{ secrets.CRATES_IO }}
- uses: actions/checkout@v4
- name: Build binaries in "release" mode
run: cargo build -r
- name: "Package for crates.io"
run: cargo package
- name: "Publish to crates.io"
run: cargo publish
- name: Download hello app
uses: actions/download-artifact@v4
with:
name: cndk8-hello
path: ./cndk8-hello
- name: Publish hello app to GitHub Packages
run: |
curl -u "${{ github.actor }}:${{ secrets.GH_TOKEN }}" \
-X POST "https://uploads.github.com/repos/${{ github.repository }}/releases/assets?name=cndk8-hello.tar.gz" \
--header "Content-Type: application/gzip" \
--data-binary @./cndk8-hello/cndk8