1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Rust
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
buildandtest:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run default tests
run: cargo test --verbose
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack --version
- name: Run headless browser tests
run: |
wasm-pack test --headless --chrome
wasm-pack test --headless --firefox
buildreadme:
name: Build readme
runs-on: ubuntu-latest
needs: buildandtest
steps:
- uses: actions/checkout@v2
- name: Install cargo-readme
run: cargo install cargo-readme
- name: Create README.md file from src/lib.rs
run: cargo readme -i src/lib.rs -o README.md
- uses: EndBug/add-and-commit@v7 # You can change this to use a specific version
with:
# The arguments for the `git add` command (see the paragraph below for more info)
# Default: '.'
add: 'README.md'
# Name of the branch to use, if different from the one that triggered the workflow
# Default: the branch that triggered the run
branch: main
# Determines the way the action fills missing author name and email. Three options are available:
# - github_actor -> UserName <UserName@users.noreply.github.com>
# - user_info -> Your Display Name <your-actual@email.com>
# - github_actions -> github-actions <email associated with the github logo>
# Default: github_actor
default_author: github_actor
# The message for the commit
# Default: 'Commit from GitHub Actions (name of the workflow)'
message: 'Updated README.md'
# The flag used on the pull strategy. Use NO-PULL to avoid the action pulling at all.
# Default: '--no-rebase'
pull_strategy: NO-PULL