CI #96
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: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
schedule: | |
# run the build every Sunday at 8am | |
- cron: "0 8 * * 0" | |
jobs: | |
run: | |
name: Run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
run: | | |
rustup update --no-self-update stable && rustup default stable | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 | |
- run: cargo build | |
- name: Configure crates.io token | |
run: | | |
echo "[registry]" > $HOME/.cargo/credentials | |
echo "token = \"${{ secrets.CRATESIO_TOKEN }}\"" >> $HOME/.cargo/credentials | |
if: github.event_name != 'pull_request' | |
- run: cargo run publish ${{ secrets.GH_TOKEN }} | |
if: github.event_name != 'pull_request' | |
- run: cargo run nopublish ${{ secrets.GH_TOKEN }} | |
if: github.event_name == 'pull_request' |