-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * WIP magic * adjust scoper config * Resolve dependency hell * Make something * add build step for the nextcloud builder * add the checkout step * login to registry * use devcontainer as build-runner2 * skip the postCreate stuff when in CI * change default shell for docker build * extract some functions from the script to features * run poststartcommands in ci * fix filename * fix script for non vscode environments * remove extra install scoper step * add fail fast on install * use bash as default shell * make apt less noisy * try another fail * remove trap in distclean * add memory.ini to top * give the shell job control * just use bash * Scope dependencies (#138) Scope dependencies --------- Co-authored-by: Matthias Simonis <[email protected]> * Fix if the file size is zero, the app evaluates the file as too large to scan (cherry picked from commit c37472d) * WIP * WIP magic * adjust scoper config * Resolve dependency hell * Make something * add fail fast on install * exit early in the install script * fix stuff * add composer path to github path * split postCreate and add to path * remove the scoper installation (done in the postCreateCommand) * add container user vscode * remove vscode user * add docker ps * replace hostname in ci * add debug stuff * use static ip * show json ps * try connect the builder container to the compose network * fix name * move connect to after installation * fix hostname * add hostname to trusted_domains array * fix smtp hostname * replace quote types * remove debugging stuff --------- Co-authored-by: Lennart Dohmann <[email protected]> Co-authored-by: PT-ATA No One <[email protected]> (cherry picked from commit 06d33a6)
- Loading branch information
1 parent
9289eba
commit 37bc604
Showing
11 changed files
with
117 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
name: Build and Test | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
on: | ||
push: | ||
branches: ["main"] | ||
|
@@ -17,23 +20,47 @@ jobs: | |
- id: get-matrix | ||
run: echo "nextcloud_versions=$(./get-matrix.sh)" | tee -a "$GITHUB_OUTPUT" | ||
|
||
build-devcontainer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Pre-build dev container image | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: ghcr.io/gdatasoftwareag/nextcloud/builder | ||
cacheFrom: ghcr.io/gdatasoftwareag/nextcloud/builder | ||
push: always | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: define-matrix | ||
container: | ||
image: ghcr.io/gdatasoftwareag/nextcloud/builder:latest | ||
env: | ||
IS_CI: true | ||
options: --name nextcloud-antivirus-build-container | ||
needs: | ||
- define-matrix | ||
- build-devcontainer | ||
strategy: | ||
matrix: | ||
nextcloud_version: ${{fromJson(needs.define-matrix.outputs.nextcloud_versions)}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
name: setup node | ||
with: | ||
node-version: 20 | ||
|
||
- name: Setup BATS | ||
uses: mig4/setup-bats@v1 | ||
with: | ||
bats-version: 1.11.0 | ||
- name: postCreateCommands | ||
run: | | ||
source .devcontainer/postCreateCommands.sh | ||
- name: add composer bin to path | ||
run: | | ||
echo $(composer config home --global)/vendor/bin >> $GITHUB_PATH | ||
echo "/home/vscode/bin/" >> $GITHUB_PATH | ||
- name: replace version in ./appinfo/info.xml | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
@@ -42,11 +69,6 @@ jobs: | |
RELEASE_VERSION=${GITHUB_REF#refs/tags/} | ||
sed -i "s/<version>0.0.0<\/version>/<version>$RELEASE_VERSION<\/version>/g" ./appinfo/info.xml | ||
- uses: docker-practice/actions-setup-docker@master | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.3' | ||
|
||
- name: unittests | ||
env: | ||
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }} | ||
|
@@ -55,17 +77,16 @@ jobs: | |
composer install | ||
./vendor/bin/phpunit --bootstrap tests/unittests/bootstrap.php tests/unittests/ --testdox | ||
- name: install php-scoper | ||
run: | | ||
composer global require humbug/php-scoper | ||
echo $(composer config home --global) >> $GITHUB_PATH | ||
- name: install nextcloud | ||
env: | ||
CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }} | ||
CLIENT_SECRET: ${{ secrets.VAAS_CLIENT_SECRET }} | ||
run: ./install.sh ${{ matrix.nextcloud_version }} 1 | ||
|
||
- name: add builder into nextcloud network | ||
run: | | ||
docker network connect nextcloud-gdata-antivirus_nextcloud-network nextcloud-antivirus-build-container | ||
- name: run tests | ||
id: bats-tests | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,5 @@ core.1 | |
nextcloud-server/ | ||
core-dump.zip | ||
apache/ | ||
**/vendor/* | ||
**/vendor/* | ||
test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.