Skip to content

Commit

Permalink
fix(ci)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsuu committed Apr 18, 2024
1 parent 2e06389 commit e414e5d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 51 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Deploy static content to Pages

# on:
# # Runs on pushes targeting the default branch
# push:
# branches: ["main"]
#
# # Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*"

jobs:
create-release:
release:
name: release
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
needs: ["create-release"]
strategy:
matrix:
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
build: [linux, linux-arm, macos, win-msvc]
include:
- build: linux-x86_64
os: ubuntu-latest
Expand All @@ -54,32 +54,33 @@ jobs:
os: windows-latest
rust: nightly
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-latest
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.os }}
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}

- name: Add mingw64 to path for x86_64
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
if: matrix.rust == 'nightly'
shell: bash

run: |
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Install dependencies
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt update -y
sudo apt install -y curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libwayland-egl1-mesa libwayland-client++0 libwayland-client-extra++0
fi
- name: Build
shell: bash
run: |
export RUSTFLAGS="-Awarnings"
cargo build --release
- name: Build archive
shell: bash
run: |
Expand All @@ -97,7 +98,6 @@ jobs:
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
Expand All @@ -109,5 +109,4 @@ jobs:
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream


# REFS: https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
24 changes: 16 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ on:
pull_request:

jobs:
build-build:
build:
name: test
strategy:
matrix:
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
include:
- build: linux
os: ubuntu-22.04
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: linux-arm
os: ubuntu-22.04
os: ubuntu-latest
rust: nightly
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-12
rust: nightly
target: x86_64-apple-darwin
- build: win-msvc
os: windows-2022
os: windows-latest
rust: nightly
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-2022
os: windows-latest
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
- build: win32-msvc
os: windows-2022
os: windows-latest
rust: nightly
target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-test
Expand All @@ -49,9 +49,17 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Add mingw64 to path for x86_64-gnu
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
if: matrix.rust == 'nightly'
shell: bash
run: |
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Install dependencies
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt update -y
sudo apt install -y curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libwayland-egl1-mesa libwayland-client++0 libwayland-client-extra++0
fi
- name: Build and Test
shell: bash
run: |
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: wasm

# on:
# push:
# branches:
# - main
# pull_request:
on:
push:
branches:
- main
pull_request:

jobs:
build-build:
build:
name: wasm
strategy:
matrix:
build: [linux]
include:
- build: linux
os: ubuntu-22.04
os: ubuntu-lastest
rust: nightly
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-test
Expand All @@ -34,8 +34,9 @@ jobs:
export RUSTFLAGS="-Awarnings"
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
rustup target add wasm32-unknown-unknown
#cargo install wasm-pack
export PATH="$PATH:/home/runner/.cargo/bin/"
cargo install wasm-pack
bash build_web.zsh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
16 changes: 9 additions & 7 deletions build_web.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ build() {
--out-name web.wasm
}

server(){
dufs --render-index \
--allow-search \
./www
#--enable-cors \
}
# server(){
# dufs --render-index \
# --allow-search \
# ./www
# #--enable-cors \
# }
#
#build && server

build && server
build
7 changes: 0 additions & 7 deletions examples/gcd.rs

This file was deleted.

0 comments on commit e414e5d

Please sign in to comment.