Skip to content

Commit

Permalink
Merge pull request #122 from openzim/ci-macos-silicon
Browse files Browse the repository at this point in the history
Simplify/Unify CI Github Workflow
  • Loading branch information
kelson42 authored Dec 9, 2023
2 parents e4be633 + 9e4e1fa commit 55f4111
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 80 deletions.
95 changes: 15 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,95 +10,34 @@ on:
- main

jobs:

macOS:
runs-on: macos-12

strategy:
matrix:
node-version: [18, 20]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: installing add on packages
run: brew install ossp-uuid

- name: setting path
run: PATH=$PATH:$HOME/bin

- name: installing dependencies
run: npm i

- name: installing typescript
run: npm i -g typescript

- name: running lint
run: npm run lint

- name: running test
run: npm run test

Ubuntu-Focal:
runs-on: ubuntu-20.04

CI:
strategy:
fail-fast: false
matrix:
node-version: [18, 20]
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13]
node: [18, 20, 21]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}

- name: installing add on packages
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt install gcc g++ python3-pip libbz2-dev ccache zlib1g-dev uuid-dev

- name: setting path
run: PATH=$PATH:$HOME/bin

- name: installing dependencies
run: npm i

- name: installing typescript
run: npm i -g typescript

- name: running lint
run: npm run lint

- name: running test
run: npm run test

Ubuntu-Jammy:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18, 20]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
node-version: ${{ matrix.node-version }}
python-version: '3.11'

- name: installing add on packages
run: sudo apt install gcc g++ python3-pip libbz2-dev ccache zlib1g-dev uuid-dev
if: startsWith(matrix.os, 'macos')
run: brew install ossp-uuid

- name: setting path
run: PATH=$PATH:$HOME/bin
Expand All @@ -109,22 +48,18 @@ jobs:
- name: installing typescript
run: npm i -g typescript

- name: installing codecov
if: ${{ matrix.node-version == '20' }}
run: npm i codecov

- name: running lint
run: npm run lint

- name: running test
run: npm run test

- name: running codecov
if: ${{ matrix.node-version == '20' }}
if: ${{ matrix.node == '20' && matrix.os == 'ubuntu-20.04' }}
run: npm run codecov

- name: codecov action
if: ${{ matrix.node-version == '20' }}
if: ${{ matrix.node == '20' && matrix.os == 'ubuntu-20.04' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions download-libzim.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ const urlParser = require("url");

mkdirp.sync("./download");

console.info("os.type() is:", os.type());
console.info("os.arch() is:", os.arch());
const isMacOS = os.type() === "Darwin";
const isLinux = os.type() === "Linux";
const rawArch = os.arch();

const isAvailableArch =
rawArch === "x64" || rawArch === "arm" || rawArch === "arm64";

Expand Down

0 comments on commit 55f4111

Please sign in to comment.