Skip to content

Commit 81ae160

Browse files
authored
Merge pull request #651 from fortran-lang/gnikit/issue650
ci: set gfortran to v11 on GitHub actions
2 parents 3a0bd6d + dd56e53 commit 81ae160

File tree

2 files changed

+41
-39
lines changed

2 files changed

+41
-39
lines changed

.github/workflows/main.yaml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,37 @@ name: CI
22
on: [push, pull_request]
33
jobs:
44
tests:
5-
runs-on: ubuntu-latest
65
strategy:
76
matrix:
8-
node-version: [16.x, 18.x]
7+
os: [ubuntu-latest]
8+
gcc_v: [11]
9+
node-version: [18.x]
910
fail-fast: false
11+
runs-on: ${{ matrix.os }}
12+
env:
13+
FC: gfortran-${{ matrix.gcc_v }}
14+
CC: gcc-${{ matrix.gcc_v }}
15+
CXX: g++-${{ matrix.gcc_v }}
16+
GCC_V: ${{ matrix.gcc_v }}
17+
1018
steps:
1119
- uses: actions/checkout@v3
1220
- name: Use Node.js ${{ matrix.node-version }}
1321
uses: actions/setup-node@v3
1422
with:
1523
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install GCC compilers Linux
26+
if: contains( matrix.os, 'ubuntu')
27+
run: |
28+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
29+
sudo apt-get update
30+
sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V}
31+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
32+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
33+
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
34+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
35+
1636
- name: Installing Extension
1737
run: npm ci
1838
- name: Compile
@@ -24,30 +44,12 @@ jobs:
2444
- name: Test Unittests
2545
uses: GabrielBB/xvfb-action@v1
2646
with:
27-
run: npm test
28-
29-
coverage:
30-
strategy:
31-
matrix:
32-
os: [ubuntu-latest]
33-
node-version: [18.x]
34-
fail-fast: false
35-
runs-on: ${{ matrix.os }}
36-
steps:
37-
- uses: actions/checkout@v3
38-
- name: Use Node.js ${{ matrix.node-version }}
39-
uses: actions/setup-node@v3
40-
with:
41-
node-version: ${{ matrix.node-version }}
42-
43-
- name: Installing Extension
44-
run: npm ci
45-
47+
run: npm run test
48+
# This will not fail the job if tests fail so we have to npm test separately
4649
- name: Coverage report
4750
uses: GabrielBB/xvfb-action@v1
4851
with:
4952
run: npm run coverage
50-
5153
- name: Upload coverage to Codecov
5254
uses: codecov/codecov-action@v3
5355
with:

test/linter-provider.test.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ suite('Linter integration', () => {
3434
doc = await workspace.openTextDocument(fileUri);
3535
await window.showTextDocument(doc);
3636
});
37-
// FIXME: different versions of gfortran report the error at a different column number
37+
// different versions of gfortran report the error at a different column number
3838
// need to implement a the compiler versioning see #523
39-
// test('GNU - API call to doLint produces correct diagnostics', async () => {
40-
// const diags = await new FortranLintingProvider()['doLint'](doc);
41-
// const ref: Diagnostic[] = [
42-
// new Diagnostic(
43-
// new Range(new Position(21 - 1, 18 - 1), new Position(21 - 1, 18 - 1)),
44-
// 'Syntax error in argument list at (1)',
45-
// DiagnosticSeverity.Error
46-
// ),
47-
// new Diagnostic(
48-
// new Range(new Position(7 - 1, 9 - 1), new Position(7 - 1, 9 - 1)),
49-
// "Type specified for intrinsic function 'size' at (1) is ignored [-Wsurprising]",
50-
// DiagnosticSeverity.Warning
51-
// ),
52-
// ];
39+
test('GNU - API call to doLint produces correct diagnostics', async () => {
40+
const diags = await new FortranLintingProvider()['doLint'](doc);
41+
const ref: Diagnostic[] = [
42+
new Diagnostic(
43+
new Range(new Position(21 - 1, 18 - 1), new Position(21 - 1, 18 - 1)),
44+
'Syntax error in argument list at (1)',
45+
DiagnosticSeverity.Error
46+
),
47+
new Diagnostic(
48+
new Range(new Position(7 - 1, 9 - 1), new Position(7 - 1, 9 - 1)),
49+
"Type specified for intrinsic function 'size' at (1) is ignored [-Wsurprising]",
50+
DiagnosticSeverity.Warning
51+
),
52+
];
5353

54-
// deepStrictEqual(diags, ref);
55-
// });
54+
deepStrictEqual(diags, ref);
55+
});
5656

5757
test('Include path globs & internal variable resolution', async () => {
5858
const paths = linter['getGlobPathsFromSettings']('linter.includePaths');

0 commit comments

Comments
 (0)