diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d0e701..8ed3972 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Cache Dependancies + - name: Cache Dependencies uses: actions/cache@v4 with: path: | @@ -50,7 +50,7 @@ jobs: with: directory: 'dist' add_suffix: false - + - name: Bundle Build Artifacts run: mkdir oceanchat-${{ github.run_number }} && cp -r ./dist ./oceanchat-${{ github.run_number }}/dist && cp ./target/release-server/ocean-chat ./oceanchat-${{ github.run_number }}/ocean-chat @@ -59,3 +59,4 @@ jobs: with: path: ./oceanchat-${{ github.run_number }} name: oceanchat-${{ github.run_number }} + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2d9a81f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Cache Dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-oceanchat-cache-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-oceanchat-cache- + + - name: Update Rust + run: rustup update + + - name: Run Tests with Server Feature + run: cargo test --features server +