Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Aug 7, 2024
1 parent 8e4b0a3 commit 8ec2967
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 19 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ jobs:
with:
version: "v0.7.4"

- run: cargo build --release
working-directory: server
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: enstate-server
path: server/target/release/enstate

- name: Docker meta
id: meta
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: PR Pre-Build
on:
workflow_call:

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Pre-Build ENState 🔨
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "on"
RUSTC_WRAPPER: "sccache"
strategy:
fail-fast: false
matrix:
suite: [server] #, worker]
include:
- suite: server
build: cargo build --release
env_file: .env
# - suite: worker
# build: bun install --global pnpm && pnpm install && pnpm build
# env_file: .dev.vars
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v1

- name: Configure sccache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
with:
version: "v0.7.4"

- name: Build
run: ${{ matrix.build }}
working-directory: ${{ matrix.suite }}

- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: enstate-server
path: server/target/release/enstate
retention-days: 1
17 changes: 13 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ env:
CARGO_TERM_COLOR: always

jobs:
prebuild:
name: Prebuild ENState 🧪
uses: ./.github/workflows/prebuild.yml
secrets: inherit
test:
name: Test ENState 🚀
# runs-on: arc-runner-set
runs-on: ubuntu-latest
needs: [prebuild]
env:
SCCACHE_GHA_ENABLED: "on"
RUSTC_WRAPPER: "sccache"
Expand All @@ -22,7 +27,6 @@ jobs:
suite: [server] #, worker]
include:
- suite: server
build: cargo build --release
env_file: .env
# - suite: worker
# build: bun install --global pnpm && pnpm install && pnpm build
Expand Down Expand Up @@ -62,9 +66,14 @@ jobs:
EOF
working-directory: ${{ matrix.suite }}

- name: Build
run: ${{ matrix.build }}
working-directory: ${{ matrix.suite }}
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: enstate-server
path: server/target/release/enstate
# - name: Build
# run: ${{ matrix.build }}
# working-directory: ${{ matrix.suite }}

- name: Test
run: bun test ${{ matrix.suite }} --timeout 10000 --rerun-each 2
Expand Down
13 changes: 0 additions & 13 deletions test/tests/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ const TEST_RELEASE = true;
let server: Subprocess | undefined;

beforeAll(async () => {
console.log('Building server...');

await new Promise<void>((resolve) => {
Bun.spawn(['cargo', 'build', TEST_RELEASE ? '--release' : ''], {
cwd: '../server',
onExit() {
resolve();
},
});
});

console.log('Build finished!');

server = Bun.spawn([`../server/target/${TEST_RELEASE ? 'release' : 'debug'}/enstate`], {

Check failure on line 18 in test/tests/server.spec.ts

View workflow job for this annotation

GitHub Actions / Test ENState 🧪 / Test ENState 🚀 (server)

TypeError: Executable not found in $PATH: "../server/target/release/enstate"

at /home/runner/work/enstate/enstate/test/tests/server.spec.ts:18:18 at /home/runner/work/enstate/enstate/test/tests/server.spec.ts:17:11 at test_implementation (/home/runner/work/enstate/enstate/test/src/test_implementation.ts:10:5) at /home/runner/work/enstate/enstate/test/tests/server.spec.ts:49:1 at 2:1
cwd: '../server',
});
Expand Down

0 comments on commit 8ec2967

Please sign in to comment.