Skip to content

Commit edfb353

Browse files
authored
fix: assorted tweaks so the crate builds again (#15)
* fix: make crate build again * Add checks badge * Use appropriate commit for push/pr * Update to latest Alire * Force config file generation * Name the workflow * Disable final codecov step on macos * Force publishing and skip actual PR creation
1 parent b1446f2 commit edfb353

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

.github/workflows/main.yml

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Main
2+
13
on: # Run the workflow for each of the following events:
24
push: # - A branch is pushed or updated.
35
pull_request: # - A pull-request is opened or updated.
@@ -8,22 +10,22 @@ on: # Run the workflow for each of the following events:
810
jobs:
911
main:
1012
strategy:
11-
13+
1214
fail-fast: false # Don't stop all the workflows when one of them fails.
13-
15+
1416
matrix:
15-
os: [ubuntu-latest, windows-latest, macos-latest] # List of GitHub Actions platform to run the workflow on
17+
os: [ubuntu-latest, windows-latest, macos-13] # List of GitHub Actions platform to run the workflow on
1618

1719
runs-on: ${{ matrix.os }} # Run the continuous integration workflow on each OS listed in the matrix.
18-
20+
1921
steps:
2022
# Check-out the repository
2123
- uses: actions/checkout@v2
2224

2325
# Install and setup Alire package manager
24-
- uses: alire-project/setup-alire@v1
26+
- uses: alire-project/setup-alire@v4
2527
with:
26-
version: 1.2.0-rc1
28+
version: 2.0.2
2729

2830
# Build the project using the validation build profile to enforce static analysis and coding style.
2931
- run: alr build --validation
@@ -32,11 +34,11 @@ jobs:
3234
- run: alr gnatprove -j0 --level=4
3335

3436
# Instrument the project code for coverage analysis.
35-
- run: cd tests && alr gnatcov instrument --level=stmt --dump-trigger=atexit --projects ada_spark_workflow.gpr
37+
- run: cd tests && alr build && alr gnatcov instrument --level=stmt --dump-trigger=atexit --projects ada_spark_workflow.gpr
3638

3739
# Build testsuite with instrumented code.
3840
- run: cd tests && alr build -- --src-subdirs=gnatcov-instr --implicit-with=gnatcov_rts_full
39-
41+
4042
# Run the instrumented testsuite. This will produce at least one `.srctrace` file for the coverage analysis.
4143
- run: cd tests && alr exec ./bin/tests
4244

@@ -45,22 +47,29 @@ jobs:
4547

4648
# Upload the code coverage analysis results to codecov.io
4749
- uses: alire-project/gnatcov-to-codecovio-action@main
50+
if: matrix.os != 'macos-13'
51+
# TODO: diagnose why it fails on macOS
4852
with:
4953
fail_ci_if_error: false # Don't fail the workflow if codecov.io failed
5054
verbose: true
5155

5256
# Produce an Alire release manifest
53-
- name: Make Release Manifest
57+
- name: Configure Github credentials and generate manifest
58+
shell: bash
5459
run: |
5560
# Set user GitHub login required for `alr publish`
56-
alr config --set --global user.github_login ${{github.repository_owner}}
57-
58-
# Run Alire publish assistant
59-
alr publish ${{github.server_url}}/${{github.repository}} ${{github.sha}}
61+
alr settings --set --global user.github_login ${{github.repository_owner}}
62+
63+
# Run Alire publish assistant with the appropriate commit
64+
# Force to allow generation for -dev version
65+
alr -f publish --skip-submit \
66+
${{github.server_url}}/${{github.repository}} \
67+
${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
6068
6169
# Save the path to the release manifest for the next step.
6270
# This is a little trick to get around the fact that the actions/upload-release-asset doesn't allow globing pattern.
6371
- name: Get Release Manifest PATH
72+
shell: bash
6473
run: |
6574
export MANIFEST_PATHNAME=$(ls alire/releases/*.toml | head -n 1)
6675
echo MANIFEST_PATHNAME=$MANIFEST_PATHNAME >> $GITHUB_ENV

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Ada SPARK Workflow
22
A demo of best practices for open-source Ada/SPARK development.
33

4+
[![checks](https://github.com/alire-project/ada_spark_workflow/workflows/main/badge.svg)](https://github.com/alire-project/ada_spark_workflow/actions)
45
[![codecov](https://codecov.io/gh/alire-project/ada_spark_workflow/branch/main/graph/badge.svg?token=9PZQ67LBPF)](https://codecov.io/gh/alire-project/ada_spark_workflow)
56

67
The goal of this repository is to show the best practices for Ada/SPARK open-source development. We will do our best to keep it updated with the latest technologies and services from Alire and GitHub. Don’t hesitate to suggest enhancements in case we missed something interesting.
@@ -293,7 +294,7 @@ The procedure is:
293294
contribute it to the Alire index.
294295
- Update the version number in `alire.toml` on the development branch
295296

296-
Push bug fixes to the MINOR release branch and only update the PATCH number
297+
Push bug fixes to the MINOR release branch and only update the PATCH number
297298

298299
### `PATCH` Releases
299300

alire.toml

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ website = "alire.ada.dev"
1010
licenses = "MIT"
1111

1212
[[depends-on]]
13+
gnat = "^12"
14+
# Normally you don't want to depend on specific compiler versions, so you could
15+
# remove this dependency in your project.
16+
1317
resources = "~0.1.0"
1418
gnatprove = "^11.2.3"
1519

0 commit comments

Comments
 (0)