mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-09-24 23:31:50 +02:00
re-enable CI
This commit is contained in:
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: bezierinfo
|
78
.github/workflows/ci.yml
vendored
Normal file
78
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: CI-CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'docs/fonts'
|
||||
- 'docs/images'
|
||||
- 'docs/ja-JP'
|
||||
- 'docs/uk-UA'
|
||||
- 'docs/zn-CH'
|
||||
- 'docs/*.{html,php,md,css}'
|
||||
- 'docs/news/*.html'
|
||||
- 'temp'
|
||||
- 'README.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Building the Primer website
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Installing TeX Live
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install xzdec libpoppler-glib-dev texlive texlive-xetex texlive-extra-utils -y
|
||||
|
||||
- name: Installing pdf2svg
|
||||
run: |
|
||||
set +e
|
||||
rm -f *.tar.gz
|
||||
set -e
|
||||
wget https://github.com/dawbarton/pdf2svg/archive/v0.2.3.tar.gz
|
||||
tar -zxf v0.2.3.tar.gz
|
||||
cd pdf2svg-0.2.3
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
cd ..
|
||||
set +e
|
||||
rm -rf pdf2svg-0.2.3
|
||||
rm v0.2.3.tar.gz
|
||||
pdf2svg
|
||||
set -e
|
||||
|
||||
- name: Installing latest Node
|
||||
run: |
|
||||
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
|
||||
sh ~/.nvm/nvm.sh install latest
|
||||
sh ~/.nvm/nvm.sh use latest
|
||||
|
||||
- name: Installing dependencies
|
||||
run: |
|
||||
npm install
|
||||
echo "finished installing dependencies"
|
||||
|
||||
- name: Running npm build
|
||||
run: |
|
||||
echo "running build..."
|
||||
npm run deploy:nocopy
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
echo "forming commit..."
|
||||
git status
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "Bezierinfo CI"
|
||||
set +e
|
||||
git add -A
|
||||
git commit -m "Automated build"
|
||||
set -e
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
21
test.js
21
test.js
@@ -1,21 +0,0 @@
|
||||
const lookup = {};
|
||||
|
||||
const arrays = [
|
||||
[0, 1, 2, 3, 4, 4, 4, 4],
|
||||
[5, 6, 7, 8, 9, 10, 11, 11],
|
||||
[2, 7, 10, 12],
|
||||
[0, 7, 10, 14]
|
||||
];
|
||||
|
||||
const reduced = arrays.map((array, index) => {
|
||||
for(let i=array.length-1; i>=0; i--) {
|
||||
let value = array[i];
|
||||
let knownIndex = (lookup[value] = lookup[value] ?? index);
|
||||
if (knownIndex < index) {
|
||||
array.splice(i,1);
|
||||
}
|
||||
}
|
||||
return array;
|
||||
});
|
||||
|
||||
console.log(reduced);
|
Reference in New Issue
Block a user