From 76164379f38087123192c6f1cffaefe3aae5a8a9 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:10:36 +0300 Subject: [PATCH 01/12] CI: add Playtests --- .github/workflows/Build.yml | 42 ++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 15efd7d..3083cb8 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -10,6 +10,47 @@ on: workflow_dispatch: jobs: + playtest: + runs-on: ubuntu-latest + container: rehldsorg/testdemos:latest + strategy: + fail-fast: false + matrix: + branch: + - steam_legacy + - public + mod: + # - valve + - cstrike + # - czero + # - dod + # - gearbox + # - tfc + # - ricochet + # - dmc + test: [ + { type: 'rehlds', file: 'cstrike-muliplayer-1', desc: 'CS: Multiplayer' }, + { type: 'rehlds', file: 'rehlds-phys-single1', desc: 'Half-Life: Physics singleplayer' }, + { type: 'rehlds', file: 'crossfire-1-multiplayer-1', desc: 'Half-Life: Multiplayer on crossfire map' }, + { type: 'rehlds', file: 'shooting-hl-1', desc: 'Half-Life: Shooting with several weapons' }, + { type: 'regamedll', file: 'cstrike-basic-1', desc: 'CS: Testing jumping, scenarios, shooting etc' }, + ] + env: + imageName: testdemos_local + steps: + - uses: actions/checkout@v4 + + - name: Build container + run: docker build -t $imageName ./Dockerfile + + - name: Prepare + run: rsync -a deps/${{ matrix.test.type }}/* . + + - name: Run test + env: + demo: ${{ matrix.test.file }} + desc: ${{ matrix.test.desc }} + run: docker run -t $imageName ./runTests.sh build: runs-on: ubuntu-latest @@ -34,7 +75,6 @@ jobs: steps: - uses: actions/checkout@v4.2.0 - uses: docker/setup-buildx-action@v3.7.0 - - name: Log in to Docker Hub if: ${{ env.needToPush }} uses: docker/login-action@v3.3.0 From 23220d6998a564ac1fc5094b3a46e4e31acf4ddc Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:13:39 +0300 Subject: [PATCH 02/12] test --- .github/workflows/Build.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 3083cb8..29ade1f 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -16,30 +16,31 @@ jobs: strategy: fail-fast: false matrix: - branch: - - steam_legacy - - public - mod: - # - valve - - cstrike - # - czero - # - dod - # - gearbox - # - tfc - # - ricochet - # - dmc + # branch: + # - steam_legacy + # - public + # mod: + # # - valve + # - cstrike + # # - czero + # # - dod + # # - gearbox + # # - tfc + # # - ricochet + # # - dmc test: [ { type: 'rehlds', file: 'cstrike-muliplayer-1', desc: 'CS: Multiplayer' }, - { type: 'rehlds', file: 'rehlds-phys-single1', desc: 'Half-Life: Physics singleplayer' }, - { type: 'rehlds', file: 'crossfire-1-multiplayer-1', desc: 'Half-Life: Multiplayer on crossfire map' }, - { type: 'rehlds', file: 'shooting-hl-1', desc: 'Half-Life: Shooting with several weapons' }, - { type: 'regamedll', file: 'cstrike-basic-1', desc: 'CS: Testing jumping, scenarios, shooting etc' }, + # { type: 'rehlds', file: 'rehlds-phys-single1', desc: 'Half-Life: Physics singleplayer' }, + # { type: 'rehlds', file: 'crossfire-1-multiplayer-1', desc: 'Half-Life: Multiplayer on crossfire map' }, + # { type: 'rehlds', file: 'shooting-hl-1', desc: 'Half-Life: Shooting with several weapons' }, + # { type: 'regamedll', file: 'cstrike-basic-1', desc: 'CS: Testing jumping, scenarios, shooting etc' }, ] env: imageName: testdemos_local steps: - uses: actions/checkout@v4 + - run: ls -la - name: Build container run: docker build -t $imageName ./Dockerfile From 438ca1c9e1068590dbb6a02d059561be621bd566 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:15:43 +0300 Subject: [PATCH 03/12] test --- .github/workflows/Build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 29ade1f..7ab57d1 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -12,7 +12,6 @@ on: jobs: playtest: runs-on: ubuntu-latest - container: rehldsorg/testdemos:latest strategy: fail-fast: false matrix: @@ -40,9 +39,9 @@ jobs: steps: - uses: actions/checkout@v4 - - run: ls -la + - run: ls -la && echo $imageName - name: Build container - run: docker build -t $imageName ./Dockerfile + run: docker build -t $imageName ./Dockerfile - name: Prepare run: rsync -a deps/${{ matrix.test.type }}/* . From 3c977c20d8f9b464f2d3f15c49628f71f714aaf6 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:17:19 +0300 Subject: [PATCH 04/12] test --- .github/workflows/Build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 7ab57d1..7efafff 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -38,10 +38,9 @@ jobs: imageName: testdemos_local steps: - uses: actions/checkout@v4 - - - run: ls -la && echo $imageName + - name: Build container - run: docker build -t $imageName ./Dockerfile + run: docker build -t $imageName . - name: Prepare run: rsync -a deps/${{ matrix.test.type }}/* . From e7838d7d955b94442b2f182fa94c766310d95223 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:20:19 +0300 Subject: [PATCH 05/12] test --- .github/workflows/Build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 7efafff..eec82ac 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -43,6 +43,7 @@ jobs: run: docker build -t $imageName . - name: Prepare + working-directory: ./testdemos_files run: rsync -a deps/${{ matrix.test.type }}/* . - name: Run test From e8228c5496c4bd1c22adaf2b0638ed92c74016aa Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:25:40 +0300 Subject: [PATCH 06/12] test --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index eec82ac..db57181 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -50,7 +50,7 @@ jobs: env: demo: ${{ matrix.test.file }} desc: ${{ matrix.test.desc }} - run: docker run -t $imageName ./runTests.sh + run: docker run -t $imageName ./runTest.sh build: runs-on: ubuntu-latest From 5075db0d8beaf72d7c70cdc30638e1ad6c9dca13 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:30:26 +0300 Subject: [PATCH 07/12] env test --- .github/workflows/Build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index db57181..8da5bee 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -50,9 +50,15 @@ jobs: env: demo: ${{ matrix.test.file }} desc: ${{ matrix.test.desc }} - run: docker run -t $imageName ./runTest.sh + run: | + docker run \ + -t $imageName \ + --env demo \ + --env desc \ + ./runTest.sh build: + if: false runs-on: ubuntu-latest strategy: matrix: From 9bddec06b8e0bb4579951784c4d18f88d74b53a3 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:35:46 +0300 Subject: [PATCH 08/12] add cache --- .github/workflows/Build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 8da5bee..c06d07d 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -39,22 +39,27 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build container - run: docker build -t $imageName . - + - uses: actions/cache@v4 + with: + path: . + key: ${{ matrix.test.type }} + - name: Prepare working-directory: ./testdemos_files run: rsync -a deps/${{ matrix.test.type }}/* . + - name: Build container + run: docker build -t $imageName . + - name: Run test env: demo: ${{ matrix.test.file }} desc: ${{ matrix.test.desc }} run: | docker run \ - -t $imageName \ --env demo \ --env desc \ + -t $imageName \ ./runTest.sh build: From d0bd062a4ec5a4b24f64a1ed28f93e02a2a53b8a Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:45:15 +0300 Subject: [PATCH 09/12] test --- .github/workflows/Build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index c06d07d..99bdd32 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/cache@v4 with: - path: . + path: /var/lib/docker/ key: ${{ matrix.test.type }} - name: Prepare From 30a0def2e0ca431807e9389856e67a8a39ffbb13 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:54:21 +0300 Subject: [PATCH 10/12] fix --- .github/workflows/Build.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 99bdd32..3630cc2 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -41,15 +41,21 @@ jobs: - uses: actions/cache@v4 with: - path: /var/lib/docker/ - key: ${{ matrix.test.type }} + path: /tmp/.buildx-cache + key: ${{ runner.os }}-docker-${{ matrix.test.type }} + restore-keys: | + ${{ runner.os }}-docker- - name: Prepare working-directory: ./testdemos_files run: rsync -a deps/${{ matrix.test.type }}/* . - name: Build container - run: docker build -t $imageName . + run: | + docker build \ + --cache-from=type=local,src=/tmp/.buildx-cache \ + --cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \ + -t $imageName . - name: Run test env: From 3e92005ed7de98486981b9ceded1e63c70cc50aa Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 16:57:45 +0300 Subject: [PATCH 11/12] test --- .github/workflows/Build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 3630cc2..2c3cb87 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -53,8 +53,8 @@ jobs: - name: Build container run: | docker build \ - --cache-from=type=local,src=/tmp/.buildx-cache \ - --cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \ + --cache-from=type=gha,src=/tmp/.buildx-cache \ + --cache-to=type=gha,dest=/tmp/.buildx-cache-new,mode=max \ -t $imageName . - name: Run test From 5a01bb182ff9cebecbbaad683c877ffba11599ff Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Thu, 17 Oct 2024 17:01:53 +0300 Subject: [PATCH 12/12] dd --- .github/workflows/Build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 2c3cb87..96894dd 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -53,11 +53,12 @@ jobs: - name: Build container run: | docker build \ - --cache-from=type=gha,src=/tmp/.buildx-cache \ - --cache-to=type=gha,dest=/tmp/.buildx-cache-new,mode=max \ + --cache-from=type=gha \ + --cache-to=type=gha,mode=max \ -t $imageName . - name: Run test + if: false env: demo: ${{ matrix.test.file }} desc: ${{ matrix.test.desc }}