From c57d16e8d532d37669637fc7701440f1f20212d8 Mon Sep 17 00:00:00 2001 From: jiro4989 Date: Sat, 30 May 2020 14:05:45 +0000 Subject: Add CI workflow --- .github/workflows/test.yml | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..34f4742 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,71 @@ +name: test + +on: + push: + pull_request: + +jobs: + skip: + runs-on: ubuntu-latest + steps: + - run: echo "Skip job" + + before: + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[skip ci]')" + steps: + - run: echo "not contains '[skip ci]'" + + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + nim_version: + - '1.2.0' + - 'stable' + needs: before + steps: + - uses: actions/checkout@v1 + + - name: Set cache-key + id: vars + run: | + if [[ ${{ matrix.nim_version }} == stable ]]; then + echo ::set-output name=cache-key::$(date +%Y-%m-%d) + else + echo ::set-output name=cache-key::${{ matrix.nim_version }} + fi + shell: bash + + - name: Print cache-key + run: echo cache-key = ${{ steps.vars.outputs.cache-key }} + + - name: Cache choosenim + id: cache-choosenim + uses: actions/cache@v1 + with: + path: ~/.choosenim + key: ${{ runner.os }}-choosenim-${{ steps.vars.outputs.cache-key }} + - name: Cache nimble + id: cache-nimble + uses: actions/cache@v1 + with: + path: ~/.nimble + key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} + - uses: jiro4989/setup-nim-action@v1 + with: + nim-version: ${{ matrix.nim_version }} + + - name: Test examples + run: | + cd examples + for file in $(ls -v example_*nim); do + echo "=== test: $file ===" + nim c "$file" + echo "" + done + shell: bash -- cgit v1.2.3 From 0c14ea79ee23a4cbdbc4d7dbc11be4955b381b7a Mon Sep 17 00:00:00 2001 From: jiro4989 Date: Sat, 30 May 2020 14:08:24 +0000 Subject: Add config.nims for 'import nigui' --- examples/config.nims | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/config.nims diff --git a/examples/config.nims b/examples/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/examples/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file -- cgit v1.2.3