emotion fix #70
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: Backend | |
on: push | |
jobs: | |
codestyle: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
components: rustfmt | |
- uses: actions/checkout@v2 | |
- run: cd backend && cargo fmt --all -- --check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
components: clippy | |
- uses: actions/checkout@v2 | |
- run: cd backend && cargo clippy --all-targets -- -D clippy::all | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
- uses: actions/checkout@v2 | |
- run: cd backend && cargo check --all | |
test: | |
needs: [codestyle, lint, compile] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Rust | |
uses: hecrj/setup-rust-action@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Test | |
run: | | |
cd backend | |
echo ${{ secrets.ENV_FILE }} > .env | |
cargo test | |
continue-on-error: true | |
# deploy on pushes to master branch | |
# assumes aws credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) | |
# are configured in travis settings | |
# see https://serverless.com/framework/docs/providers/aws/guide/credentials/ | |
# for more information | |
deploy: | |
if: github.ref == 'refs/heads/release' | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Set up Rust | |
uses: hecrj/setup-rust-action@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Deploy | |
if: env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: eu-west-2 | |
run: | | |
cd backend | |
echo ${{ secrets.ENV_FILE }} > .env | |
sudo apt-get install musl-tools | |
export CC_x86_64_unknown_linux_musl=musl-gcc | |
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc | |
rustup target add x86_64-unknown-linux-musl | |
yarn install --frozen-lockfile | |
yarn sls deploy --conceal --stage prod |