Skip to content

server / rolling

server / rolling #903

Workflow file for this run

# Run scheduled (rolling) jobs on a nightly basis, as your crate may break independently of any
# given PR. E.g., updates to rust nightly and updates to this crates dependencies. See check.yml for
# information about how the concurrency cancellation and workflow triggering works
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
paths:
- 'server/**'
- '.github/workflows/scheduled.yml'
schedule:
- cron: '7 7 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: server / rolling
jobs:
# https://twitter.com/alcuadrado/status/1571291687837732873
update:
# This action checks that updating the dependencies of this crate to the latest available that
# satisfy the versions in Cargo.toml does not break this crate. This is important as consumers
# of this crate will generally use the latest available crates. This is subject to the standard
# Cargo semver rules (i.e cargo does not update to a new major version unless explicitly told
# to).
runs-on: ubuntu-latest
name: ubuntu / beta / updated
defaults:
run:
working-directory: ./server
# There's no point running this if no Cargo.lock was checked in in the first place, since we'd
# just redo what happened in the regular test job. Unfortunately, hashFiles only works in if on
# steps, so we repeat it.
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install beta
if: hashFiles('server/Cargo.lock') != ''
uses: dtolnay/rust-toolchain@beta
- name: cargo update
if: hashFiles('server/Cargo.lock') != ''
run: cargo update
- name: Download DynamoDB Local
if: hashFiles('server/Cargo.lock') != ''
run: |
wget https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz
wget https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz.sha256
sha256sum --check dynamodb_local_latest.tar.gz.sha256
mkdir dynamodb-local
tar xfv dynamodb_local_latest.tar.gz --directory=dynamodb-local
ls -lah dynamodb-local
- name: Install Java SDK
if: hashFiles('server/Cargo.lock') != ''
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21'
- name: Launch DynamoDB Local
if: hashFiles('server/Cargo.lock') != ''
run: |
cd dynamodb-local
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb &
- name: Create tables and indexes in DynamoDb Local
if: hashFiles('server/Cargo.lock') != ''
run: ./run-migrations.sh http://localhost:8000
env:
AWS_ACCESS_KEY_ID: carpe
AWS_SECRET_ACCESS_KEY: diem
AWS_DEFAULT_REGION: dead-poets-society-eu-east-1
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test
if: hashFiles('server/Cargo.lock') != ''
run: cargo test --locked --all-features --all-targets -- --include-ignored
env:
RUSTFLAGS: -D deprecated
USE_DYNAMODB: local