Skip to content

Bump actions/upload-artifact from 3 to 4 #50

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #50

Workflow file for this run

name: Compress images
# Environment variables
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Controls when the action will run.
on:
push:
paths:
- "icons/**"
- "companyportal/**"
- ".github/workflows/compress-images.yml"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
validate:
name: 'Validate and compress icons'
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Install modules
shell: pwsh
working-directory: "${{ github.workspace }}"
run: |
.\tests\Install-Modules.ps1
# Run Pester tests
- name: Test images
shell: pwsh
working-directory: "${{ github.workspace }}"
run: |
Import-Module -Name "Pester" -Force -ErrorAction "Stop"
$Config = New-PesterConfiguration
$Config.Run.Path = "${{ github.workspace }}\tests"
$Config.Run.PassThru = $True
$Config.TestResult.Enabled = $True
$Config.TestResult.OutputFormat = "NUnitXml"
$Config.TestResult.OutputPath = "${{ github.workspace }}\tests\TestsResults.xml"
Invoke-Pester -Configuration $Config
# Upload test results
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
path: "${{ github.workspace }}\\tests\\TestResults.xml"
# Publish test results
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
nunit_files: "${{ github.workspace }}\\tests\\TestResults.xml"
- name: Compress images
shell: pwsh
working-directory: "${{ github.workspace }}"
run: |
. .\bin\Optimise-Images.ps1 -Path "${{ github.workspace }}"
- name: Commit changes
id: commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Validate and compress icons: ${{ github.run_number }}"
commit_user_name: ${{ secrets.COMMIT_NAME }}
commit_user_email: ${{ secrets.COMMIT_EMAIL }}