Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
flmichel committed Jul 9, 2023
1 parent 362bc68 commit 1bbfba9
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 99 deletions.
97 changes: 89 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,101 @@ name: CI

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

env:
CARGO_TERM_COLOR: always
SQLX_VERSION: 0.6.2
SQLX_FEATURES: "rustls,postgres"

jobs:
build:
server:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./server

services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
ports:
- 5432:5432
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Install the Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Rust Cache Action
uses: Swatinem/rust-cache@v2
with:
key: sqlx-${{ env.SQLX_VERSION }}

- name: Install sqlx-cli
run: cargo install sqlx-cli
--version=${{ env.SQLX_VERSION }}
--features ${{ env.SQLX_FEATURES }}
--no-default-features
--locked

- name: Install postgresql-client
run: sudo apt-get update && sudo apt-get install postgresql-client -y

- name: Migrate database
run: SKIP_DOCKER=true ./script/init_db.sh

- name: Run tests
run: cargo test

game:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./game

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Check out repository code
uses: actions/checkout@v3

- name: Install the Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Rust Cache Action
uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test

remote:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./remote

strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Build and Test
run: npm run build
46 changes: 0 additions & 46 deletions configuration/tekton/github/configure-webhook.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions configuration/tekton/pipeline/build-game.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions configuration/tekton/pipeline/clone-repo.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions configuration/tekton/pipeline/pipline.yaml

This file was deleted.

5 changes: 3 additions & 2 deletions remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "concurrently --kill-others \" npm run build \" \" npm run serve \" ",
"start": "concurrently --kill-others \" npm run build-watch \" \" npm run serve \" ",
"serve": "webpack serve",
"build": "webpack --watch"
"build-watch": "webpack --watch",
"build": "webpack"
},
"author": "",
"license": "ISC",
Expand Down
2 changes: 1 addition & 1 deletion server/script/init_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ DB_PASSWORD="${POSTGRES_PASSWORD:=password}"
DB_NAME="${POSTGRES_DB:=tank-game}"
DB_PORT="${POSTGRES_PORT:=5432}"

sudo systemctl start docker
if [[ -z "${SKIP_DOCKER}" ]]
then
sudo systemctl start docker
docker run \
-e POSTGRES_USER=${DB_USER} \
-e POSTGRES_PASSWORD=${DB_PASSWORD} \
Expand Down
3 changes: 3 additions & 0 deletions tank-game.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
},
{
"path": "configuration"
},
{
"path": ".github"
}
],
"settings": {
Expand Down

0 comments on commit 1bbfba9

Please sign in to comment.