From 62eff5e82795c4e3bb75b4fc53e12fb562b3618b Mon Sep 17 00:00:00 2001 From: Jakub Duras Date: Sat, 11 Nov 2023 16:02:36 +0100 Subject: [PATCH] Replace Azure pipelines with GH Actions --- .github/workflows/package.yaml | 39 +++++++++ azure-pipelines.yml | 154 --------------------------------- package-lock.json | 11 +-- 3 files changed, 43 insertions(+), 161 deletions(-) create mode 100644 .github/workflows/package.yaml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml new file mode 100644 index 0000000..da410a2 --- /dev/null +++ b/.github/workflows/package.yaml @@ -0,0 +1,39 @@ +name: Test + +on: [push] + +jobs: + build: + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - os: ubuntu-latest + - os: macos-latest + - os: windows-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: 'Install node modules' + run: 'npm install' + + - name: 'Build translations' + run: 'yarn build:translations' + + - name: 'Test' + run: 'yarn test' + + - name: 'Test UI' + if: runner.os == 'Linux' + run: 'yarn test:ui' + env: + PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} + + - name: 'Build' + run: 'yarn build' + + - name: 'Build backends' + run: 'yarn build:backends' diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 355037c..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,154 +0,0 @@ -trigger: -- master - -strategy: - matrix: - linux: - imageName: 'ubuntu-18.04' - mac: - imageName: 'macOS-10.14' - windows: - imageName: 'windows-2019' - -pool: - vmImage: $(imageName) - -steps: -- checkout: self - submodules: true - -- task: InstallAppleCertificate@2 - inputs: - certSecureFile: 'mac.p12' - certPwd: '$(MACP12PASSWORD)' - keychain: 'temp' - deleteCert: true - condition: and(eq( variables['sign'], true ), eq( variables['Agent.OS'], 'Darwin' )) - displayName: Install Apple Signing Certificate - -- task: DownloadSecureFile@1 - name: signingCertificate - condition: and(eq( variables['sign'], true ), ne( variables['Agent.OS'], 'Darwin' )) - displayName: 'Download Windows & Linux Signing certificate' - inputs: - secureFile: 'windows.pfx' - -- task: NodeTool@0 - inputs: - versionSpec: '12.x' - displayName: 'Install Node.js' - -# There should be ENV variables like "JAVA_HOME_11_X64" see https://github.com/microsoft/azure-pipelines-tasks/blob/a24321075eae67b13d0865e4199d5ef82d3effca/Tasks/Common/java-common/java-common.ts#L45 -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'echo "##vso[task.setvariable variable=JAVA_HOME;]$JAVA_HOME_11_X64"' - displayName: 'Set JAVA_HOME to JDK v11' -- task: Bash@3 - inputs: - targetType: 'inline' - script: | - echo "JAVA_HOME=$JAVA_HOME" - java -version - condition: eq(variables['System.Debug'], true) - displayName: 'DEBUG: Show java home and version' - -# Temporary disabled caching due to issues on Mac and Linux (executable permissions?) -# https://github.com/durasj/octosign/issues/4 -# We should cache ~/.cache too for cypress & electron -#- task: CacheBeta@0 -# inputs: -# key: 'npm | $(Agent.OS) | $(Build.SourcesDirectory)/package-lock.json' -# path: $(Pipeline.Workspace)/.npm -# condition: eq( variables['Agent.OS'], 'Windows_NT' ) -# displayName: 'Cache node_modules' - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'npm install' - displayName: 'Install node modules' - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'yarn build:translations' - displayName: 'Build translations' - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'yarn test' - displayName: 'Test' - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'yarn test:ui' - env: - PERCY_TOKEN: $(PERCY_TOKEN) - condition: eq(variables['Agent.OS'], 'Linux') - displayName: 'Test UI' - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'yarn build' - displayName: 'Build' - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'yarn build:backends' - displayName: 'Build backends' - -- bash: echo "##vso[task.setvariable variable=CSC_LINK]$AGENT_TEMPDIRECTORY/windows.pfx" - condition: and(eq( variables['sign'], true ), ne( variables['Agent.OS'], 'Darwin' )) - displayName: Set CSC_LINK for signing if wanted - -- bash: | - echo '##vso[task.setvariable variable=NOTARIZE]1' - condition: and(eq( variables['sign'], true ), eq( variables['Agent.OS'], 'Darwin' )) - displayName: Set NOTARIZE for macOS notarization if wanted - -- task: Bash@3 - inputs: - targetType: 'inline' - script: yarn dist - env: - GH_TOKEN: $(GH_TOKEN) - CSC_KEY_PASSWORD: $(WINPFXPASSWORD) - APPLEID: $(APPLEID) - APPLEIDPASS: $(APPLEIDPASS) - displayName: 'Create and upload distributables' - -# We are currently not able to run smoke test on the Linux -# https://github.com/durasj/octosign/issues/11 -#- task: Bash@3 -# inputs: -# targetType: 'inline' -# script: sudo apt-get update && sudo apt-get install libgconf-2-4 -y -# condition: eq(variables['Agent.OS'], 'Linux') -# displayName: 'Prepare Linux for smoke test' -#- task: Bash@3 -# inputs: -# targetType: 'inline' -# script: 'xvfb-run --auto-servernum --server-args="-screen 0, 1600x900x24" "npm run test:smoke"' -# displayName: 'Run smoke test' -# condition: eq(variables['Agent.OS'], 'Linux') - -- task: Bash@3 - inputs: - targetType: 'inline' - script: 'yarn test:smoke' - displayName: 'Run smoke test' - condition: ne(variables['Agent.OS'], 'Linux') - -- task: Bash@3 - inputs: - targetType: 'inline' - script: npx codecov --disable=gcov - env: - CODECOV_TOKEN: $(CODECOV_TOKEN) - condition: eq(variables['Agent.OS'], 'Linux') - displayName: 'Upload code coverage' diff --git a/package-lock.json b/package-lock.json index b3e9422..f7fc8e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "sanitize-filename": "^1.6.3", "split2": "^3.2.2", "tmp-promise": "^3.0.3", - "yaml": "^1.9.2" + "yaml": "^1.10.2" }, "devDependencies": { "@material-ui/core": "^4.9.11", @@ -27818,12 +27818,9 @@ "dev": true }, "node_modules/yaml": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", - "integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", - "dependencies": { - "@babel/runtime": "^7.9.2" - }, + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "engines": { "node": ">= 6" }