Skip to content

feat: go - https

feat: go - https #92

Workflow file for this run

---
# SPDX-FileCopyrightText: © 2024 Sebastian Davids <sdavids@gmx.de>
# SPDX-License-Identifier: Apache-2.0
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: ci
on: # yamllint disable-line rule:truthy
push:
branches:
- main
- next
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
permissions: { }
jobs:
# unfortunately each job is billed for at least 1 minute in GH Actions
# so use one big one to save GH Action minutes
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions
lint-build-test:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
uses: actions/checkout@v4.2.2
- name: Classify changes
# https://github.com/dorny/paths-filter/releases
uses: dorny/paths-filter@v3.0.2
id: changes
with:
filters: |
sh:
- '**.sh'
yaml:
- '**.yaml'
js-nodejs-Dockerfile:
- .hadolint.yaml
- js/nodejs/Dockerfile
js-nodejs:
- js/nodejs/.npmrc
- js/nodejs/.nvmrc
- js/nodejs/eslint.config.mjs
- js/nodejs/package.json
- js/nodejs/package-lock.json
- js/nodejs/prettier.config.mjs
- 'js/nodejs/src/**.mjs'
- 'js/nodejs/test/**.mjs'
go-http-Dockerfile:
- .hadolint.yaml
- go/http/Dockerfile
go-http:
- go/http/go.mod
- go/http/go.sum
- 'go/http/**.go'
go-https-Dockerfile:
- .hadolint.yaml
- go/https/Dockerfile
go-https:
- go/https/go.mod
- go/https/go.sum
- 'go/https/**.go'
rust-http-Dockerfile:
- .hadolint.yaml
- rust/http/Dockerfile
rust-http:
- 'rust/http/src/**'
- 'rust/http/tests/**'
- rust/http/Cargo.lock
- rust/http/Cargo.toml
- rust/http/rust-toolchain.toml
rust-https-Dockerfile:
- .hadolint.yaml
- rust/https/Dockerfile
rust-https:
- 'rust/https/src/**'
- 'rust/https/tests/**'
- rust/https/Cargo.lock
- rust/https/Cargo.toml
- rust/https/rust-toolchain.toml
- if: steps.changes.outputs.sh == 'true'
name: Lint shell scripts
run: scripts/shellscript_check.sh
- if: steps.changes.outputs.yaml == 'true'
name: Lint YAML files
run: yamllint --strict .
# --- js/nodejs ----------------------------------------------------------
- if: steps.changes.outputs.js-nodejs-Dockerfile == 'true'
name: Lint js/nodejs Dockerfile
# https://github.com/hadolint/hadolint-action/releases
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: js/nodejs/Dockerfile
- if: steps.changes.outputs.js-nodejs == 'true'
name: Setup node and install dependencies for js/nodejs
uses: ./.github/actions/setup-node-and-install-dependencies
with:
working-directory: js/nodejs
node-version-file: js/nodejs/.nvmrc
dependencies-lock-file: js/nodejs/package-lock.json
- if: steps.changes.outputs.js == 'true'
name: Check js/nodejs formatting
working-directory: js/nodejs
run: scripts/format_check.sh
- if: steps.changes.outputs.js == 'true'
name: Lint js/nodejs files
working-directory: js/nodejs
run: scripts/lint.sh
- if: steps.changes.outputs.js == 'true'
name: Test js/nodejs
working-directory: js/nodejs
run: scripts/test.sh
# --- go/http ----------------------------------------------------------
- if: steps.changes.outputs.go-http-Dockerfile == 'true'
name: Lint go/http/Dockerfile
# https://github.com/hadolint/hadolint-action/releases
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: go/http/Dockerfile
- if: steps.changes.outputs.go-http == 'true'
name: Install Go for go/http
# https://github.com/actions/setup-go/releases
uses: actions/setup-go@v5.1.0
with:
go-version-file: go/http/go.mod
- if: steps.changes.outputs.go-http == 'true'
name: Lint go/http files
# https://github.com/golangci/golangci-lint-action/releases
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.61.0
working-directory: go/http
- if: steps.changes.outputs.go-http == 'true'
name: Test go/http
working-directory: go/http
run: scripts/test.sh
- if: steps.changes.outputs.go-http == 'true'
name: Build go/http
working-directory: go/http
run: scripts/build_release.sh
# --- go/https ----------------------------------------------------------
- if: steps.changes.outputs.go-https-Dockerfile == 'true'
name: Lint go/https/Dockerfile
# https://github.com/hadolint/hadolint-action/releases
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: go/https/Dockerfile
- if: steps.changes.outputs.go-https == 'true'
name: Install Go for go/https
# https://github.com/actions/setup-go/releases
uses: actions/setup-go@v5.1.0
with:
go-version-file: go/https/go.mod
- if: steps.changes.outputs.go-https == 'true'
name: Lint go/https files
# https://github.com/golangci/golangci-lint-action/releases
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.61.0
working-directory: go/https
- if: steps.changes.outputs.go-https == 'true'
name: Test go/https
working-directory: go/https
run: scripts/test.sh
- if: steps.changes.outputs.go-https == 'true'
name: Build go/https
working-directory: go/https
run: scripts/build_release.sh
# --- rust/http ------------------------------------------------------
- if: steps.changes.outputs.rust-http-Dockerfile == 'true'
name: Lint rust/http Dockerfile
# https://github.com/hadolint/hadolint-action/releases
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: rust/http/Dockerfile
- if: steps.changes.outputs.rust-http == 'true'
name: Install rust/http Rust
working-directory: rust/http
run: rustup show
- if: steps.changes.outputs.rust-http == 'true'
name: Cache rust/http Rust files
# https://github.com/Swatinem/rust-cache/releases
uses: Swatinem/rust-cache@v2.7.5
with:
shared-key: rust-http
workspaces: rust/http
- if: steps.changes.outputs.rust-http == 'true'
name: Check rust/http formatting
working-directory: rust/http
run: scripts/format_check.sh
- if: steps.changes.outputs.rust-http == 'true'
name: Lint rust/http files
working-directory: rust/http
run: scripts/lint.sh
- if: steps.changes.outputs.rust-http == 'true'
name: Test rust/http
working-directory: rust/http
run: cargo test --no-fail-fast
- if: steps.changes.outputs.rust-http == 'true'
name: Build rust/http
working-directory: rust/http
run: scripts/build_release.sh
# --- rust/https -----------------------------------------------------
- if: steps.changes.outputs.rust-https-Dockerfile == 'true'
name: Lint rust/https Dockerfile
# https://github.com/hadolint/hadolint-action/releases
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: rust/https/Dockerfile
- if: steps.changes.outputs.rust-https == 'true'
name: Install rust/https Rust
working-directory: rust/https
run: rustup show
- if: steps.changes.outputs.rust-https == 'true'
name: Cache rust/https Rust files
# https://github.com/Swatinem/rust-cache/releases
uses: Swatinem/rust-cache@v2.7.5
with:
shared-key: rust-https
workspaces: rust/https
- if: steps.changes.outputs.rust-https == 'true'
name: Check rust/https formatting
working-directory: rust/https
run: scripts/format_check.sh
- if: steps.changes.outputs.rust-https == 'true'
name: Lint rust/https files
working-directory: rust/https
run: scripts/lint.sh
- if: steps.changes.outputs.rust-https == 'true'
name: Test rust/https
working-directory: rust/https
run: cargo test --no-fail-fast
- if: steps.changes.outputs.rust-https == 'true'
name: Build rust/https
working-directory: rust/https
run: scripts/build_release.sh