From 3b952f886211bc1ddf694d7ace6e3fc9fde31762 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Sat, 14 Jun 2025 22:38:49 +0200 Subject: [PATCH] CI updates + devcontainer --- .devcontainer/Containerfile | 4 ++ .devcontainer/devcontainer.json | 18 +++++++ .github/dependabot.yml | 4 ++ .github/workflows/test.yml | 84 ++++++++++++--------------------- 4 files changed, 57 insertions(+), 53 deletions(-) create mode 100644 .devcontainer/Containerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile new file mode 100644 index 00000000..819c032d --- /dev/null +++ b/.devcontainer/Containerfile @@ -0,0 +1,4 @@ +FROM docker.io/library/ubuntu:latest + +RUN apt-get update +RUN apt-get install -y shellcheck shfmt jq npm git diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..dc806388 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node +{ + "name": "devcontainer", + "build": { + "dockerfile": "Containerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "GitHub.vscode-github-actions", + "esbenp.prettier-vscode", + "mads-hartmann.bash-ide-vscode", + "ms-azuretools.vscode-containers" + ] + } + } +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 13f7eb20..60dba31d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -22,3 +22,7 @@ updates: pull-request-branch-name: separator: "-" open-pull-requests-limit: 10 +- package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86b9e7cc..3ad9a4c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,66 +11,44 @@ on: jobs: main: runs-on: ubuntu-latest + services: + mailpit: + image: docker.io/axllent/mailpit:latest + ports: + - 1025:1025 + - 8025:8025 strategy: max-parallel: 1 - matrix: - include: - - subject: Plain body (attachment) - attachments: action.yml - body: | - first line - second line - - subject: HTML body (attachments) - attachments: package.json,package-lock.json - html_body: | - - - -

Heading

-

Paragraph

- - - - subject: file://testdata/subject.txt - convert_markdown: true - body: file://README.md - - subject: HTML body (Markdown) - convert_markdown: true - html_body: file://README.md - - subject: Multipart body (Markdown) - convert_markdown: true - body: file://README.md - html_body: file://README.md steps: - name: Checkout code uses: actions/checkout@v4 + - name: Send mail uses: ./ with: - server_address: ${{secrets.ADDRESS}} - server_port: 465 - username: ${{secrets.USERNAME}} - password: ${{secrets.PASSWORD}} - subject: ${{matrix.subject}} - body: ${{matrix.body}} - html_body: ${{matrix.html_body}} - to: ${{github.event.pusher.email}} - from: github-actions - attachments: ${{matrix.attachments}} - convert_markdown: ${{matrix.convert_markdown}} + connection_url: smtp://localhost:1025 + server_address: localhost + server_port: 1025 + secure: false + username: test + password: test + subject: Test Email + to: obiwan@example.com,yoda@example.com + from: Luke Skywalker + body: |- + This is a test email sent from a GitHub Action. + Please check the attachments and other fields. + html_body: file://README.md + cc: leia@example.com + bcc: owen@example.com + reply_to: vader@example.com + in_reply_to: palpatine@example.com + ignore_cert: false + convert_markdown: true + attachments: package.json,action.yml priority: high - url-test: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Send mail - uses: ./ - with: - connection_url: smtp+starttls://${{secrets.USERNAME}}:${{secrets.PASSWORD}}@${{secrets.ADDRESS}}/ - subject: Plain body with connection_url - body: | - first line - second line - to: ${{github.event.pusher.email}} - from: github-actions + - name: Get mail + run: | + curl -s "http://localhost:8025/api/v1/message/latest/raw" + curl -s "http://localhost:8025/api/v1/message/latest" | jq