diff --git a/.github/workflows/.gitmodules b/.github/workflows/.gitmodules new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/.github/workflows/.gitmodules @@ -0,0 +1 @@ + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1699261dbc..c138c255f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,9 @@ name: ci on: - - push - - pull_request + push: + branches: [ main, develop ] + pull_request: jobs: test: @@ -13,16 +14,30 @@ jobs: base_image: ["ubuntu:noble", "debian:bookworm"] steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 - - name: Check available cgroups - run: | - mount | grep cgroup + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.docker-cache + key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }} + restore-keys: | + ${{ runner.os }}-docker- - - name: Build docker image - run: | - docker compose -p cms -f docker/docker-compose.test.yml build \ - --build-arg BASE_IMAGE=${{ matrix.base_image }} testcms + - name: Set up Docker buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile.test + push: false + tags: testcms + cache-from: type=local,src=/tmp/.docker-cache + cache-to: type=local,dest=/tmp/.docker-cache + build-args: BASE_IMAGE=${{ matrix.base_image }} - name: Run tests run: | diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29bb2..0000000000