Skip to content

Bump actions/setup-node from 1 to 4 (#129) #446

Bump actions/setup-node from 1 to 4 (#129)

Bump actions/setup-node from 1 to 4 (#129) #446

Workflow file for this run

on:
push:
branches:
- main
pull_request:
schedule:
- cron: '30 3 * * 2'
name: CI
jobs:
backend:
name: Build and test backend
runs-on: ubuntu-latest
services:
postgres:
image: mdillon/postgis:11
env:
POSTGRES_USER: flugbuech
POSTGRES_PASSWORD: flugbuech
POSTGRES_DB: flugbuech_test
ports:
- 5432:5432
# Needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install -y libpq-dev
- uses: dtolnay/rust-toolchain@1.72.0
- name: Run check
run: cargo check --all-features
- name: Run tests
run: cargo test --all-features
env:
TEST_DATABASE_URL: 'postgres://flugbuech:flugbuech@localhost:5432/flugbuech_test'
frontend:
name: Build frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '12'
- run: npm install
- run: npm run build
clippy:
name: Run clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install -y libpq-dev
- uses: dtolnay/rust-toolchain@1.72.0
with:
components: clippy
- run: cargo clippy --all-features
rustfmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.72.0
with:
components: rustfmt
- run: cargo fmt -- --check
#eslint: Disabled until https://github.com/sveltejs/eslint-plugin-svelte3/issues/10 is fixed
# name: Run eslint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: '12'
# - run: npm install
# - run: npm run lint
docker_image:
name: Build Docker image
runs-on: ubuntu-latest
needs: [backend, frontend]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build \
--no-cache \
-t dbrgn/flugbuech:latest \
-t dbrgn/flugbuech:main \
.
- name: Push Docker image
run: |
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" && \
docker push dbrgn/flugbuech:main && \
docker push dbrgn/flugbuech:latest