Skip to content

Commit

Permalink
feat: GitHub Actions workflow attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Sep 18, 2024
1 parent 14513cf commit 55d770c
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI
on:
push:
branches: [ master ]
tags-ignore:
- '*'
pull_request:
branches: [ master ]
jobs:
build:
# if: "!contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
if: "github.event_name == 'pull_request' || !contains(github.event.head_commit.message, 'skip ci')"
# runs-on: ubuntu-latest # / ubuntu-18.04 ... or ubuntu-16.04, ubuntu-20.04
# runs-on: macos-latest # / macos-10.15
# runs-on: windows-2016 # not window-latest / windows-2019, see https://github.com/edrlab/thorium-reader/issues/1591
runs-on: ${{ matrix.runson }}
strategy:
fail-fast: false
matrix:
# windows-arm
osarch: [windows-intel, macos-intel, macos-arm, linux-intel, linux-arm]
include:
- osarch: windows-intel
runson: windows-latest
# - osarch: windows-arm
# runson: windows-latest
- osarch: macos-intel
runson: macos-13
- osarch: macos-arm
runson: macos-latest
- osarch: linux-intel
runson: ubuntu-20.04
- osarch: linux-arm
runson: ubuntu-20.04
steps:
- run: 'echo "GITHUB_RUN_NUMBER: ${{ github.run_number }}"'
- run: 'echo "GITHUB_RUN_ID: ${{ github.run_id }}"'
- run: 'echo "GITHUB_SHA: ${{ github.sha }}"'
- name: Check sys arch
if: ${{ matrix.osarch != 'windows-intel' }}
run: echo "${{ matrix.osarch }}" && uname -m && arch
- name: Checkout
uses: actions/checkout@v4
- name: Git config global dump (post)
run: 'git config --global --list || echo NO_GIT_GLOBAL_CONFIG || true'
shell: bash
- name: Git config local dump (post)
run: 'git config --list || echo NO_GIT_GLOBAL_CONFIG || true'
shell: bash
- uses: actions/setup-node@v4
with:
node-version: '20'
#check-latest: true
- run: node --version && npm --version
- run: npm --global install npm@^10
- run: npm --version
- run: npm --global install yarn@^1
- run: yarn --version
- run: git --no-pager diff
- run: yarn install --frozen-lockfile
# - name: PR action
# if: ${{ github.event_name == 'pull_request' }}
# run: echo PR
- name: non-PR action, Windows
if: ${{ github.event_name != 'pull_request' && ( matrix.osarch == 'windows-intel' || matrix.osarch == 'windows-arm' ) }}
run: echo "${{ matrix.osarch }}" && yarn test && yarn test-cli && yarn test-electron && yarn test-electron-cli
- name: non-PR action, non-Windows
if: ${{ github.event_name != 'pull_request' && matrix.osarch != 'windows-intel' && matrix.osarch != 'windows-arm' }}
run: echo "${{ matrix.osarch }}" && yarn test && yarn test-cli && yarn test-electron && yarn test-electron-cli

0 comments on commit 55d770c

Please sign in to comment.