From 29bc13431d2e1ab6866aa07bb619bcd3c04161d2 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Thu, 14 Mar 2024 10:27:55 +0100 Subject: [PATCH 1/3] updated tests to run them all --- .github/workflows/javascript-test.yml | 56 +++++++++++++-------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/.github/workflows/javascript-test.yml b/.github/workflows/javascript-test.yml index 19045fa..0ada31f 100644 --- a/.github/workflows/javascript-test.yml +++ b/.github/workflows/javascript-test.yml @@ -1,43 +1,39 @@ name: Continuous testing -on: [pull_request] +on: + pull_request: + push: + branches: ["main"] jobs: - lint: + test: + strategy: + matrix: + command: [lint, build, test] runs-on: ubuntu-latest + name: running ${{ matrix.command }} steps: - - uses: actions/checkout@v3 - - name: Use node 18 - uses: actions/setup-node@v3 + - uses: actions/checkout@v4.1.1 + - uses: actions/setup-node@v4.0.2 with: - node-version: 18 - - uses: c-hive/gha-yarn-cache@v2 - - name: Install dependencies - run: yarn install --frozen-lockfile - - run: yarn run lint - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use node 18 - uses: actions/setup-node@v3 + node-version: 20 + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules with: - node-version: 18 - - uses: c-hive/gha-yarn-cache@v2 + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}- - name: Install dependencies run: yarn install --frozen-lockfile - - run: yarn run build + - run: yarn run ${{ matrix.command }} - test: + conclude: runs-on: ubuntu-latest + name: All tests passed + needs: [test] steps: - - uses: actions/checkout@v3 - - name: Use node 18 - uses: actions/setup-node@v3 - with: - node-version: 18 - - uses: c-hive/gha-yarn-cache@v2 - - name: Install dependencies - run: yarn install --frozen-lockfile - - run: yarn run test + - run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY From 7d52a19d93c12129a45333a6b40ce4c19216efb6 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Thu, 14 Mar 2024 10:28:04 +0100 Subject: [PATCH 2/3] updated action versions to latest --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bc8827..6a93d03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: test-image: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.1 - name: Check that the image builds run: docker build . --file Dockerfile @@ -23,7 +23,7 @@ jobs: version: ${{ steps.verification.outputs.VERSION }} exists: ${{ steps.checkTag.outputs.exists }} steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.1 - name: Extract package.json version id: package_version run: echo "VERSION=$(jq '.version' -r package.json)" >> $GITHUB_OUTPUT @@ -48,7 +48,7 @@ jobs: contents: write packages: write steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.1.1 - name: Tag version and create release run: gh release create $VERSION --generate-notes env: From eced88951d9d08569f7454aba9a92ac522f530ee Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Thu, 14 Mar 2024 10:28:10 +0100 Subject: [PATCH 3/3] updated docker image version --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 52ee472..2cfe05e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18 as Builder +FROM node:20 as Builder WORKDIR /action @@ -10,7 +10,7 @@ COPY . . RUN yarn run build -FROM node:18-slim +FROM node:20-slim COPY --from=Builder /action/dist /action