generated from avior/template-web-astro
change some defaults
This commit is contained in:
35
.github/workflows/build_and_check.yml
vendored
35
.github/workflows/build_and_check.yml
vendored
@ -1,35 +0,0 @@
|
||||
name: Build, check & Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Check
|
||||
run: npm run check
|
||||
|
||||
- name: Prepare Tests
|
||||
run: npm run install:test
|
||||
|
||||
- name: Test
|
||||
run : npm run test
|
71
.github/workflows/build_docker.yml
vendored
71
.github/workflows/build_docker.yml
vendored
@ -1,71 +0,0 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build_docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.IMAGE_NAME }}
|
||||
# ghcr.io/${{ env.IMAGE_NAME }}
|
||||
# git.example.com/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=edge
|
||||
type=ref,event=pr
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=semver,pattern=latest
|
||||
|
||||
# - name: Login to a private registry
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# registry: git.example.com
|
||||
# username: ${{ secrets.REGISTRY_USER }}
|
||||
# password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
# - name: Login to the Docker Hub
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKER_USER }}
|
||||
# password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
# - name: Login to the Github Packages
|
||||
# uses: docker/login-action@v3
|
||||
# with:
|
||||
# registry: ghcr.io
|
||||
# username: ${{ github.actor }}
|
||||
# password: ${{ secrets.GITHUB_PACKAGES_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push the project
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./Dockerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
44
.github/workflows/delete_packages.yml
vendored
44
.github/workflows/delete_packages.yml
vendored
@ -1,44 +0,0 @@
|
||||
name: Delete Packages
|
||||
|
||||
on:
|
||||
# Run when a PR is closed/merged
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
# Run when a branch is deleted
|
||||
delete:
|
||||
|
||||
# Config
|
||||
env:
|
||||
TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
GROUP: avior
|
||||
TYPE: container
|
||||
PACKAGE: ifremer-loop
|
||||
|
||||
|
||||
jobs:
|
||||
pull_request:
|
||||
name: Delete the package on a closed Pull Request
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name == 'pull_request' && github.event.action == 'close' }}
|
||||
steps:
|
||||
- name: Delete package
|
||||
run: |
|
||||
curl --fail -X 'DELETE' "https://git.dzeio.com/api/v1/packages/${GROUP}/${TYPE}/${PACKAGE}/${VERSION}" -H 'accept: application/json' -H "Authorization: token ${TOKEN}"
|
||||
env:
|
||||
VERSION: pr-${{ github.event.number }}-head
|
||||
branch:
|
||||
runs-on: ubuntu-latest
|
||||
name: Delete the package on a deleted branch
|
||||
if: ${{ github.event_name == 'delete' }}
|
||||
steps:
|
||||
- name: Delete package
|
||||
run: |
|
||||
curl --fail -X 'DELETE' "https://git.dzeio.com/api/v1/packages/${GROUP}/${TYPE}/${PACKAGE}/${VERSION}" -H 'accept: application/json' -H "Authorization: token ${TOKEN}"
|
||||
env:
|
||||
TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
GROUP: avior
|
||||
TYPE: container
|
||||
PACKAGE: ifremer-loop
|
||||
VERSION: branch-${{ github.event.ref }}
|
||||
|
89
.github/workflows/tests.yml
vendored
Normal file
89
.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
env:
|
||||
REPO_NAME: template-desktop
|
||||
|
||||
jobs:
|
||||
static-code-checks:
|
||||
name: Static code checks
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup BunJS
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: run Astro and TypeScript checks
|
||||
run: bun run check
|
||||
run:
|
||||
name: Unit tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup BunJS
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
# - name: Prepare Tests
|
||||
# run: npm run install:test
|
||||
|
||||
- name: Test
|
||||
# run : npm run test
|
||||
run: bun run test:unit
|
||||
secrets-scanner:
|
||||
name: Secrets Scanning
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Secret Scanning
|
||||
uses: onboardbase/securelog-scan@main
|
||||
with:
|
||||
exclude: "node_modules,dist" # Comma-separated list of folders to exclude (optional)
|
||||
commits: 100 # Number of recent commits to scan (optional)
|
||||
changed: "true" # Set to "false" to scan entire repository instead of just files that was changed (optional)
|
||||
mask: "true" # that is mask secret value e.g sk_******
|
||||
verify: "true" # that is verify potential secrets against their service provider
|
||||
|
||||
sonarqube:
|
||||
name: SonarQube
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup BunJS
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install project dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Run coverage
|
||||
run: bun run test:unit
|
||||
continue-on-error: true # continue on error as we still want reporting to be done
|
||||
|
||||
- name: Scan repository
|
||||
uses: Aviortheking/sonarqube-action@v5.1.0
|
||||
with:
|
||||
host: ${{ secrets.SONARQUBE_HOST }}
|
||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
projectKey: ${{ env.REPO_NAME }}
|
||||
args: >
|
||||
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
|
Reference in New Issue
Block a user