Skip to content

Fixa typsnitt i GUI samt hindra inbäddning av otillåtna typsnitt i iXBRL #483

Fixa typsnitt i GUI samt hindra inbäddning av otillåtna typsnitt i iXBRL

Fixa typsnitt i GUI samt hindra inbäddning av otillåtna typsnitt i iXBRL #483

name: Build, Test and Package
on:
push:
branches: [ master ]
tags: [ "v*" ]
pull_request:
branches: [ master ]
schedule:
- cron: "37 1 * * *"
env:
REGISTRY: ghcr.io
jobs:
cypress-build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up environment variables
run: |
source .env.cypress
echo "INSTRUMENT_BUILD=$INSTRUMENT_BUILD" >> ${GITHUB_ENV}
echo "VITE_ENV_NAME=$VITE_ENV_NAME" >> ${GITHUB_ENV}
echo "VITE_GREDOR_BACKEND_BASEURL=$VITE_GREDOR_BACKEND_BASEURL" >> ${GITHUB_ENV}
echo "VITE_IS_CYPRESS=$VITE_IS_CYPRESS" >> ${GITHUB_ENV}
echo "VITE_TEST_MODE=$VITE_TEST_MODE" >> ${GITHUB_ENV}
- name: Build for Cypress
uses: cypress-io/github-action@v6
with:
# Disable running of tests within build job
runTests: false
build: npm run build
- name: Save build folder
uses: actions/upload-artifact@v4
with:
name: cypress-build
path: dist
if-no-files-found: error
cypress-run:
runs-on: ${{ matrix.os }}
needs: cypress-build
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
browser: [ chrome, edge, firefox ]
browser-variant: [ stable, beta ]
exclude:
- os: windows-latest
browser: edge
- os: macos-latest
browser: chrome
- os: macos-latest
browser: edge
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download build folder
uses: actions/download-artifact@v4
with:
name: cypress-build
path: dist
- name: Setup Chrome
id: setup-chrome
if: ${{ matrix.browser == 'chrome' }}
uses: browser-actions/setup-chrome@v2
with:
chrome-version: ${{ matrix.browser-variant }}
- name: Setup Edge
id: setup-edge
if: ${{ matrix.browser == 'edge' }}
uses: browser-actions/setup-edge@v1
with:
edge-version: ${{ matrix.browser-variant }}
- name: Setup Firefox
id: setup-firefox
if: ${{ matrix.browser == 'firefox' }}
uses: browser-actions/setup-firefox@v1
with:
firefox-version: ${{ matrix.browser-variant == 'beta' && 'latest-beta' || 'latest' }}
- name: Run Cypress tests
uses: cypress-io/github-action@v6
with:
start: npm run preview
browser: ${{ matrix.browser == 'chrome' && steps.setup-chrome.outputs.chrome-path || matrix.browser == 'edge' && steps.setup-edge.outputs.edge-path || steps.setup-firefox.outputs.firefox-path }}
- name: Upload coverage reports to Codecov
if: ${{ matrix.browser == 'chrome' && matrix.browser-variant == 'stable' && matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v5
with:
token: ${{ inputs.codecov_token }}
directory: ./coverage
- name: Upload test screenshots on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots_${{ matrix.os }}_${{ matrix.browser }}_${{ matrix.browser-variant }}
path: cypress/screenshots
if-no-files-found: warn
- name: Upload test videos
uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos_${{ matrix.os }}_${{ matrix.browser }}_${{ matrix.browser-variant }}
path: cypress/videos
if-no-files-found: warn
build-and-package:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: cypress-run
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get image ref
run: |
IMAGE_REF=${REGISTRY}/${GITHUB_REPOSITORY@L}
echo "IMAGE_REF=$IMAGE_REF" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_REF }}
- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
if: ${{ github.event_name == 'push' }}
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.IMAGE_REF }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true