-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify and revert optional memory ordering (#36)
* simplify and revert optional memory ordering * modernize ci * slap the compiler aroun' * run docs against mainline
- Loading branch information
Showing
5 changed files
with
115 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,14 @@ on: | |
|
||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
|
@@ -23,10 +26,10 @@ jobs: | |
# For PRs the path filter check with Github API, so no need to checkout | ||
# for them. | ||
- if: github.event_name != 'pull_request' | ||
name: Checkout (if not PR) | ||
uses: actions/checkout@v2 | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
|
@@ -51,41 +54,78 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ['macos-latest', 'ubuntu-latest'] | ||
nim: ['devel'] | ||
name: '${{ matrix.os }} (${{ matrix.nim }})' | ||
os: [ubuntu-latest] | ||
compiler: | ||
- name: nim | ||
version: version-2-0 | ||
- name: nimskull | ||
version: "*" | ||
|
||
name: '${{ matrix.os }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }})' | ||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: project | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ci | ||
path: project | ||
|
||
- name: Setup Nim | ||
- name: Nim | ||
if: matrix.compiler.name == 'nim' | ||
uses: alaviss/[email protected] | ||
with: | ||
path: nim | ||
version: ${{ matrix.nim }} | ||
version: ${{ matrix.compiler.version }} | ||
|
||
- name: Nimskull | ||
id: nimskull | ||
if: matrix.compiler.name == 'nimskull' | ||
uses: nim-works/[email protected] | ||
with: | ||
nimskull-version: ${{ matrix.compiler.version }} | ||
|
||
- name: Fetch Nimble | ||
if: matrix.compiler.name == 'nimskull' | ||
uses: actions/[email protected] | ||
with: | ||
path: nimble | ||
repository: alaviss/nimble | ||
ref: nimskull | ||
|
||
- name: Build Nimble | ||
if: matrix.compiler.name == 'nimskull' | ||
run: | | ||
nim c -d:release -o:"$NIMSKULL_BIN/nimble" src/nimble.nim | ||
# Add nimble binary folder to PATH | ||
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH" | ||
working-directory: nimble | ||
env: | ||
NIMSKULL_BIN: ${{ steps.nimskull.outputs.bin-path }} | ||
|
||
- name: Dependencies | ||
shell: bash | ||
run: | | ||
cd ci | ||
nimble --accept install "https://github.com/nim-works/cps" | ||
nimble --accept install "https://github.com/disruptek/balls" | ||
nimble --accept develop | ||
- name: Tests | ||
shell: bash | ||
- name: Tests (gcc) | ||
run: | | ||
cd ci | ||
balls --path="." --gc:arc --backend:c --define:danger --define:release | ||
balls --path="." --cc:gcc --gc:arc --backend:c --define:danger --define:release | ||
- name: Tests (clang) | ||
run: | | ||
balls --path="." --cc:clang --gc:arc --backend:c --define:danger --define:release | ||
- name: Build docs | ||
if: ${{ matrix.docs }} == 'true' | ||
shell: bash | ||
if: > | ||
github.event_name == 'push' && github.ref == 'refs/heads/main' && | ||
matrix.os == 'ubuntu-latest' && matrix.compiler.version == 'version-2-0' | ||
run: | | ||
cd ci | ||
branch=${{ github.ref }} | ||
branch=${branch##*/} | ||
nimble doc --project --outdir:docs --path="." \ | ||
|
@@ -102,19 +142,23 @@ jobs: | |
cp docs/{the,}index.html || true | ||
- name: Publish docs | ||
if: > | ||
github.event_name == 'push' && github.ref == 'refs/heads/master' && | ||
matrix.os == 'ubuntu-latest' && matrix.nim == 'devel' | ||
uses: crazy-max/ghaction-github-pages@v2.5.0 | ||
github.event_name == 'push' && github.ref == 'refs/heads/main' && | ||
matrix.os == 'ubuntu-latest' && matrix.compiler.version == 'version-2-0' | ||
uses: crazy-max/ghaction-github-pages@v3.1.0 | ||
with: | ||
build_dir: ci/docs | ||
build_dir: project/docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Set check-required on this | ||
success: | ||
needs: build | ||
if: always() | ||
runs-on: ubuntu-latest | ||
name: 'All check passes' | ||
steps: | ||
- run: | | ||
echo "This is a workaround for Github's broken software" | ||
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | ||
name: 'Fail when previous jobs fails' | ||
run: | | ||
echo "::error::One of the previous jobs failed" | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters