From ee6b975a55e91df6b3fd6882a59314c6621efc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Go=CC=81mez=20Bachiller?= Date: Sun, 14 Jan 2024 18:12:36 +0100 Subject: [PATCH] chore: set test github action --- .github/workflows/ci-cd.yaml | 21 +++++++++++++++++++-- next.config.js | 1 + package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 59765f7..0f48b5b 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -13,9 +13,26 @@ env: DOCKER_BUILDKIT: 1 jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + node: [ 18 ] + name: Run tests on Node ${{ matrix.node }} + steps: + - uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'yarn' + - run: yarn install --frozen-lockfile + - run: yarn test:ci + images: runs-on: ubuntu-latest if: github.event_name == 'push' && github.repository == 'aulasoftwarelibre/codex' && (startsWith(github.ref, 'refs/heads/releases/') || startsWith(github.ref, 'refs/tags/v') ) + needs: tests steps: - uses: actions/checkout@v4 - name: Set up QEMU @@ -37,7 +54,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract tag name id: extract_tag - run: echo "::set-output name=tag::$(echo ${GITHUB_REF##*/})" + run: echo "TAG=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v5 with: @@ -45,7 +62,7 @@ jobs: push: true tags: | ghcr.io/aulasoftwarelibre/codex:latest - ghcr.io/aulasoftwarelibre/codex:${{ steps.extract_tag.outputs.tag }} + ghcr.io/aulasoftwarelibre/codex:${{ steps.extract_tag.outputs.TAG }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - name: Move cache diff --git a/next.config.js b/next.config.js index 469b6f1..7807915 100644 --- a/next.config.js +++ b/next.config.js @@ -22,6 +22,7 @@ const nextConfig = { }] : [], ], }, + output: 'standalone' } module.exports = nextConfig diff --git a/package.json b/package.json index 78ba26f..e8fd956 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "prisma:generate": "prisma generate" }, "dependencies": { - "@aulasoftwarelibre/next-auth-firewall": "^1.0.2", + "@aulasoftwarelibre/next-auth-firewall": "^1.1.0", "@auth/prisma-adapter": "^1.0.14", "@heroicons/react": "^2.1.1", "@nextui-org/react": "2.2.9", diff --git a/yarn.lock b/yarn.lock index adf7a3b..7ab958b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,10 +34,10 @@ css-tree "^2.3.1" is-potential-custom-element-name "^1.0.1" -"@aulasoftwarelibre/next-auth-firewall@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@aulasoftwarelibre/next-auth-firewall/-/next-auth-firewall-1.0.2.tgz#841b4242aedee93419c3a815ab28136f5e6da7bb" - integrity sha512-Za6A7Vn6JIdL64NvFm+suByIEjlD5pvP34DTiA4nk8VS13DHvKFwV4lb2mPieL2AQDE//gs9MjIMqxOlHBsy8Q== +"@aulasoftwarelibre/next-auth-firewall@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@aulasoftwarelibre/next-auth-firewall/-/next-auth-firewall-1.1.0.tgz#fe9552c14b77118a3e9df280c4b694ceb0b62273" + integrity sha512-zvqTCiSdDELD4hUpTbTNqNCwbxwa9ChE+hCr2RwRONa7P09146JyobdQ9WxpUiQorWA4HwF3F+C3EPfvTRSmUQ== dependencies: "@auth/core" experimental next "^14.0.0"