diff options
| author | Simon Krauter <trustable@disroot.org> | 2020-05-31 09:40:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-31 09:40:50 +0200 |
| commit | 364364515d132ce0827d39cde99c0e3b4b03c21e (patch) | |
| tree | 440f050052185e25b9d978c8a3163781ba33987e | |
| parent | a7464ccdb303fb888cab3acc368a356dd8997d9d (diff) | |
| parent | 0c14ea79ee23a4cbdbc4d7dbc11be4955b381b7a (diff) | |
| download | NiGui-364364515d132ce0827d39cde99c0e3b4b03c21e.tar.gz NiGui-364364515d132ce0827d39cde99c0e3b4b03c21e.zip | |
Merge pull request #101 from jiro4989/feature/ci-test
Add CI testing workflow
| -rw-r--r-- | .github/workflows/test.yml | 71 | ||||
| -rw-r--r-- | examples/config.nims | 1 |
2 files changed, 72 insertions, 0 deletions
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 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 |
