Skip to content

Commit 5b7b271

Browse files
authored
Add github actions
1 parent 6c65521 commit 5b7b271

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/main.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ master ]
10+
pull_request:
11+
branches: [ master ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
test_stable:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
firefox: [ '73.0' ]
23+
include:
24+
- nim-version: 'stable'
25+
cache-key: 'stable'
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Checkout submodules
29+
run: git submodule update --init --recursive
30+
31+
- name: Setup firefox
32+
uses: browser-actions/setup-firefox@latest
33+
with:
34+
firefox-version: ${{ matrix.firefox }}
35+
36+
- name: Get Date
37+
id: get-date
38+
run: echo "::set-output name=date::$(date "+%Y-%m-%d")"
39+
shell: bash
40+
41+
- name: Cache choosenim
42+
uses: actions/cache@v2
43+
with:
44+
path: ~/.choosenim
45+
key: ${{ runner.os }}-choosenim-${{ matrix.cache-key }}
46+
47+
- name: Cache nimble
48+
uses: actions/cache@v2
49+
with:
50+
path: ~/.nimble
51+
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
52+
53+
- uses: jiro4989/setup-nim-action@v1
54+
with:
55+
nim-version: "${{ matrix.nim-version }}"
56+
57+
- name: Install geckodriver
58+
run: |
59+
sudo apt-get -qq update
60+
sudo apt-get install autoconf libtool libsass-dev
61+
wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz
62+
mkdir geckodriver
63+
tar -xzf geckodriver-v0.29.1-linux64.tar.gz -C geckodriver
64+
export PATH=$PATH:$PWD/geckodriver
65+
66+
- name: Install choosenim
67+
run: |
68+
export CHOOSENIM_CHOOSE_VERSION="stable"
69+
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
70+
sh init.sh -y
71+
export PATH=$HOME/.nimble/bin:$PATH
72+
nimble refresh -y
73+
74+
- name: Run tests
75+
run: |
76+
export MOZ_HEADLESS=1
77+
nimble -y install
78+
nimble -y test

0 commit comments

Comments
 (0)